amorynan commented on code in PR #2671: URL: https://github.com/apache/doris-website/pull/2671#discussion_r2244268936
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-count.md: ########## @@ -5,95 +5,228 @@ } --- -## 描述 +## array_count + +<version since="2.0.0"> -使用 lambda 表达式作为输入参数,对其他输入 ARRAY 参数的内部数据进行相应的表达式计算。返回使得 `lambda(array1[i], ...)` 返回值不为 0 的元素数量。如果找不到到满足此条件的元素,则返回 0。 +</version> -lambda 表达式中输入的参数为 1 个或多个,必须和后面输入的数组列数一致,且所有输入的 array 的元素个数必须相同。在 lambda 中可以执行合法的标量函数,不支持聚合函数等。 +## 描述 + +对数组中的元素应用 lambda 表达式,统计返回值不为 0 的元素个数。 ## 语法 ```sql -ARRAY_COUNT(<arr>), -ARRAY_COUNT(<lambda>, <arr> [ , <arr> ... ] ) +array_count(lambda, array1, ...) ``` -## 参数 +### 参数 + +- `lambda`:lambda 表达式,用于对数组元素进行判断和计算 +- `array1, ...`:一个或多个 ARRAY<T> 类型参数 + +**T 支持的类型:** +- 数值类型:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE、DECIMAL Review Comment: 不是所有类型啊 最好是写白名单 -- 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