This is an automated email from the ASF dual-hosted git repository.

eldenmoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new c3ab4333e86 [doc](array-function) Fix array match all/any doc for 3.0  
(#2425)
c3ab4333e86 is described below

commit c3ab4333e86bfffbdb0bd784000da69e77136479
Author: amory <wangqian...@selectdb.com>
AuthorDate: Thu May 29 12:03:59 2025 +0800

    [doc](array-function) Fix array match all/any doc for 3.0  (#2425)
    
    ## Versions
    
    - [ ] dev
    - [x] 3.0
    - [ ] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [ ] Chinese
    - [ ] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 .../array-functions/array-match-all.md             | 74 +++++++++++++++-----
 .../array-functions/array-match-any.md             | 80 +++++++++++++++++-----
 .../array-functions/array-match-all.md             | 73 +++++++++++++++-----
 .../array-functions/array-match-any.md             | 80 +++++++++++++++++-----
 4 files changed, 235 insertions(+), 72 deletions(-)

diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
index d2e2cb7bed2..7ee3706a924 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
@@ -1,25 +1,63 @@
 ---
 {
-    "title": "ARRAY_MATCH_ALL",
-    "language": "zh-CN"
+"title": "ARRAY_MATCH_ALL",
+"language": "zh-CN"
 }
 ---
 
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file distributed with this work 
for additional information regarding copyright ownership.  The ASF licenses 
this file to you under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the License.  You may obtain a copy 
of the License at
   http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the 
License for the specific language governing permissions and limitations under 
the License. -->
+
+## 描述
+
+检查数组中的所有元素是否都满足给定条件。如果数组包含 NULL 元素且所有非 NULL 元素都满足条件,则返回 NULL。
+
+## 语法
+
+```sql
+array_match_all(lambda, <arr> [, <arr> ...])
+```
+
+## 参数
+
+- `lambda`: 定义检查条件的 lambda 表达式
+- `<arr>`: 一个或多个要检查的数组。lambda 函数将应用于这些数组的每个元素
+
+## 返回值
+
+返回一个可空的布尔值:
+- 如果数组中所有元素都满足条件,则返回 `true`
+- 如果数组中任何元素不满足条件,则返回 `false`
+- 如果数组包含 NULL 元素且所有非 NULL 元素都满足条件,则返回 `NULL`
+
+## 示例
+
+```sql
+-- 检查数组中的所有数字是否都大于 5
+mysql> SELECT array_match_all(x -> x > 5, [1, 2, 3, 4, 7]);
++----------------------------------------------+
+| array_match_all(x -> x > 5, [1, 2, 3, 4, 7]) |
++----------------------------------------------+
+|                                            0 |
++----------------------------------------------+
+
+-- 检查数组中的所有数字x是否都大于数字i
+mysql> SELECT array_match_all((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_all((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  0 |
++--------------------------------------------------------------------+
+
+```
+
+## 注意事项
+
+1. 函数处理 NULL 值的方式:
+   - 如果存在 NULL 元素且所有非 NULL 元素都满足条件,则返回 NULL
+   - 如果任何非 NULL 元素不满足条件,则无论是否存在 NULL 元素都返回 false
 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
+2. 该函数适用于:
+   - 验证数组中的所有元素是否满足特定条件
+   - 与其他数组函数组合进行复杂的数组操作
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
index 60bcc28a377..2fd6693792d 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
@@ -1,25 +1,69 @@
 ---
 {
-    "title": "ARRAY_MATCH_ANY",
-    "language": "zh-CN"
+"title": "ARRAY_MATCH_ANY",
+"language": "zh-CN"
 }
 ---
 
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file distributed with this work 
for additional information regarding copyright ownership.  The ASF licenses 
this file to you under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the License.  You may obtain a copy 
of the License at
   http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the 
License for the specific language governing permissions and limitations under 
the License. -->
+
+## 描述
+
+检查数组中是否有任何元素满足给定条件。如果数组包含 NULL 元素且所有非 NULL 元素都不满足条件,则返回 NULL。
+
+## 语法
+
+```sql
+array_match_any(lambda, <arr> [, <arr> ...])
+```
+
+## 参数
+
+- `lambda`: 定义检查条件的 lambda 表达式
+- `<arr>`: 一个或多个要检查的数组。lambda 函数将应用于这些数组的每个元素
+
+## 返回值
+
+返回一个可空的布尔值:
+- 如果数组中任何元素满足条件,则返回 `true`
+- 如果数组中所有元素都不满足条件,则返回 `false`
+- 如果数组包含 NULL 元素且所有非 NULL 元素都不满足条件,则返回 `NULL`
+
+## 示例
+
+```sql
+-- 检查数组中是否有任何数字大于 5
+mysql> SELECT array_match_any(x -> x > 5, [1, 2, 3, 4, 7]);
++----------------------------------------------+
+| array_match_any(x -> x > 5, [1, 2, 3, 4, 7]) |
++----------------------------------------------+
+|                                            1 |
++----------------------------------------------+
+
+-- 检查数组中是否有任何数字大于另一个数组中对应位置的数字
+mysql> SELECT array_match_any((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_any((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  0 |
++--------------------------------------------------------------------+
+
+mysql> SELECT array_match_any((x, i) -> i > x, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_any((x, i) -> i > x, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  1 |
++--------------------------------------------------------------------+
+```
+
+## 注意事项
+
+1. 函数处理 NULL 值的方式:
+   - 如果存在 NULL 元素且所有非 NULL 元素都不满足条件,则返回 NULL
+   - 如果任何非 NULL 元素满足条件,则无论是否存在 NULL 元素都返回 true
 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
+2. 该函数适用于:
+   - 检查数组中是否有任何元素满足特定条件
+   - 与其他数组函数组合进行复杂的数组操作
\ No newline at end of file
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
index 3a3d7224280..1dbb743fb3c 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-all.md
@@ -1,25 +1,62 @@
 ---
 {
-    "title": "ARRAY_MATCH_ALL",
-    "language": "en"
+"title": "ARRAY_MATCH_ALL",
+"language": "en"
 }
 ---
 
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file distributed with this work 
for additional information regarding copyright ownership.  The ASF licenses 
this file to you under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the License.  You may obtain a copy 
of the License at
   http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the 
License for the specific language governing permissions and limitations under 
the License. -->
+
+## Description
+
+Returns true if all elements in the array match the given condition, false 
otherwise. If the array contains NULL elements and all non-NULL elements match 
the condition, returns NULL.
+
+## Syntax
+
+```sql
+array_match_all(lambda, <arr> [, <arr> ...])
+```
+
+## Parameters
+
+- `lambda`: A lambda expression that defines the condition to check for each 
element
+- `<arr>`: One or more arrays to check. The lambda function will be applied to 
each element of these arrays
+
+## Return value
+
+Returns a nullable boolean value:
+- `true` if all elements in the array match the condition
+- `false` if any element in the array does not match the condition
+- `NULL` if the array contains NULL elements and all non-NULL elements match 
the condition
+
+## Examples
+
+```sql
+-- Check if all numbers in array are greater than 5
+mysql> SELECT array_match_all(x -> x > 5, [1, 2, 3, 4, 7]);
++----------------------------------------------+
+| array_match_all(x -> x > 5, [1, 2, 3, 4, 7]) |
++----------------------------------------------+
+|                                            0 |
++----------------------------------------------+
+
+-- Check if all numbers in array are greater than corresponding numbers in 
another array
+mysql> SELECT array_match_all((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_all((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  0 |
++--------------------------------------------------------------------+
+```
+
+## Notes
+
+1. The function handles NULL values in the following way:
+   - If there are NULL elements and all non-NULL elements match the condition, 
returns NULL
+   - If any non-NULL element does not match the condition, returns false 
regardless of NULL elements
 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
+2. This function is useful for:
+   - Validating all elements in an array meet certain criteria
+   - Combining with other array functions for complex array operations
\ No newline at end of file
diff --git 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
index 374b2827914..5c83b63531c 100644
--- 
a/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
+++ 
b/versioned_docs/version-3.0/sql-manual/sql-functions/scalar-functions/array-functions/array-match-any.md
@@ -1,25 +1,69 @@
 ---
 {
-    "title": "ARRAY_MATCH_ANY",
-    "language": "en"
+"title": "array_match_any",
+"language": "en"
 }
 ---
 
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file distributed with this work 
for additional information regarding copyright ownership.  The ASF licenses 
this file to you under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the License.  You may obtain a copy 
of the License at
   http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the 
License for the specific language governing permissions and limitations under 
the License. -->
+
+## Description
+
+Returns true if any element in the array matches the given condition, false 
otherwise. If the array contains NULL elements and all non-NULL elements are 
false, returns NULL.
+
+## Syntax
+
+```sql
+array_match_any(lambda, <arr> [, <arr> ...])
+```
+
+## Parameters
+
+- `lambda`: A lambda expression that defines the condition to check for each 
element
+- `<arr>`: One or more arrays to check. The lambda function will be applied to 
each element of these arrays
+
+## Return value
+
+Returns a nullable boolean value:
+- `true` if any element in the array matches the condition
+- `false` if all elements in the array do not match the condition
+- `NULL` if the array contains NULL elements and all non-NULL elements do not 
match the condition
+
+## Examples
+
+```sql
+-- Check if any number in array is greater than 5
+mysql> SELECT array_match_any(x -> x > 5, [1, 2, 3, 4, 7]);
++----------------------------------------------+
+| array_match_any(x -> x > 5, [1, 2, 3, 4, 7]) |
++----------------------------------------------+
+|                                            1 |
++----------------------------------------------+
+
+-- Check if any number in array is greater than corresponding numbers in 
another array
+mysql> SELECT array_match_any((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_any((x, i) -> x > i, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  0 |
++--------------------------------------------------------------------+
+
+mysql> SELECT array_match_any((x, i) -> i > x, [1, 2, 3, 4, 5], [1, 2, 3, 4, 
7]);
++--------------------------------------------------------------------+
+| array_match_any((x, i) -> i > x, [1, 2, 3, 4, 5], [1, 2, 3, 4, 7]) |
++--------------------------------------------------------------------+
+|                                                                  1 |
++--------------------------------------------------------------------+
+```
+
+## Notes
+
+1. The function handles NULL values in the following way:
+   - If there are NULL elements and all non-NULL elements do not match the 
condition, returns NULL
+   - If any non-NULL element matches the condition, returns true regardless of 
NULL elements
 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
+2. This function is useful for:
+   - Checking if any element in an array meets certain criteria
+   - Combining with other array functions for complex array operations
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to