izveigor opened a new issue, #6557:
URL: https://github.com/apache/arrow-datafusion/issues/6557

   ### Is your feature request related to a problem or challenge?
   
   Follow on to https://github.com/apache/arrow-datafusion/pull/6384
   
   The function `array_contains` was proposed @BubbaJoe in 
https://github.com/apache/arrow-datafusion/issues/6075.
   
   ### Describe the solution you'd like
   
   We have two arrays: `first_array` and `second_array`.
   The main concept of the function is to check all elements of `first_array` 
for presence in `second_array` (dimensions and iorder of elements do not affect 
the result).
   
   Examples:
   ```
   select array_contains(make_array(1, 4, 3), make_array(3, 1, 3));
   ----
   t
   ```
   
   ### Describe alternatives you've considered
   
   We can use PostgreSQL operations for checking elements of first array in 
second array (See https://www.postgresql.org/docs/current/functions-array.html):
   ```
   select make_array(1, 4, 3) @> array(3, 1, 3);
   ----
   t
   ```
   
   ```
   select make_array(2, 2, 7) <@ make_array(1, 7, 4, 2, 6);
   ----
   t
   ```
   
   We can use `array_contains` for only one element (like `contains` method in 
Rust), but I think it would be better to use the check elements of the first 
array in the second array (But the idea to use two options is not refuted)
   
   ### Additional context
   
   Similar Issues:
   https://github.com/apache/arrow-datafusion/issues/6075
   
   Similar PR:
   https://github.com/apache/arrow-datafusion/pull/6384
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to