ZhangYu0123 commented on code in PR #17931:
URL: https://github.com/apache/doris/pull/17931#discussion_r1141593990


##########
docs/zh-CN/docs/sql-manual/sql-functions/array-functions/array_exists.md:
##########
@@ -0,0 +1,114 @@
+---
+{
+    "title": "array_exists",
+    "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
+
+  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.
+-->
+
+## array_exists
+
+<version since="2.0">
+
+array_exists(lambda,array1,array2....)
+array_exists(array1)
+
+</version>
+
+### description
+
+使用一个可选lambda表达式作为输入参数,对其他的输入ARRAY参数的内部数据做对应表达式计算。当计算返回非0时,返回1;否则返回0。
+在lambda表达式中输入的参数为1个或多个,必须和后面的输入array列数量一致。在lambda中可以执行合法的标量函数,不支持聚合函数等。
+在没有使用lambda作为参数时,array1作为计算结果。
+
+```
+array_exists(x->x, array1);
+array_exists(x->(x%2 = 0), array1);
+array_exists(x->(abs(x)-1), array1);
+array_exists((x,y)->(x = y), array1, array2);
+array_exists(array1);
+```
+
+### example
+
+```shell
+
+mysql [test]>select *, array_exists(x->x>1,[1,2,3]) from array_test2 order by 
id;
++------+-----------------+-------------------------+-----------------------------------------------+
+| id   | c_array1        | c_array2                | array_exists([x] -> x(0) 
> 1, ARRAY(1, 2, 3)) |

Review Comment:
   yes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to