You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/07/21 03:03:34 UTC

[GitHub] [arrow-datafusion] Weijun-H commented on a diff in pull request #6990: Replace `array_contains` with SQL array functions: `array_has`, `array_has_any`, `array_has_all`

Weijun-H commented on code in PR #6990:
URL: https://github.com/apache/arrow-datafusion/pull/6990#discussion_r1270181588


##########
docs/source/user-guide/sql/scalar_functions.md:
##########
@@ -1522,19 +1522,49 @@ array_concat(array[, ..., array_n])
 - list_cat
 - list_concat
 
-### `array_contains`
+### `array_has`
 
-Returns true, if each element of the second array appears in the first array, otherwise false.
+Returns true if the array contains the element
 
 ```
-array_contains(first_array, second_array)
+array_has(array, element)
 ```
 
 #### Arguments
 
-- **first_array**: Array expression.
+- **array**: Array expression.
+  Can be a constant, column, or function, and any combination of array operators.
+- **element**: Scalar or Array expression.
+  Can be a constant, column, or function, and any combination of array operators.
+
+### `array_has_all`
+
+Returns true if all elements of sub-array exist in array
+
+```
+array_has_all(array, sub-array)
+```
+
+#### Arguments
+
+- **array**: Array expression.
+  Can be a constant, column, or function, and any combination of array operators.
+- **sub-array**: Array expression.
+  Can be a constant, column, or function, and any combination of array operators.
+
+### `array_has_any`
+
+Returns true if any elements exist is both array

Review Comment:
   ```suggestion
   Returns true if any elements exist in both arrays
   ```



-- 
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: github-unsubscribe@arrow.apache.org

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