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

   ### Is your feature request related to a problem or challenge?
   
   # Background
   `array_position` is the early function that follows on Postgresql.
   
   There are three types of interface now.
   ```
   array_position(array, element) 
   array_position(array, element, index)
   array_positions(array, element)
   ```
   
   `array_position(array, element) ` is the basic one. 
   > For example `array_position([1,2,3], 3)` return 3 (1-indexed).
   
   `array_position(array, element, index)`  finds the element `start_from` 
index. 
   > For example `array_position([1,2,3,4,3], 3, 4) ` return 5.
   
   `array_positions(array, element)` return all the occurrence of the elements. 
   > For example `array_positions([1,2,2,3,3,3], 2)` return [2,3].
   
   # Proposal 1 Extend the current interface
   `array_position(array, element, Option<index>, Option<n>)` that able us to 
find n elements start from `index` and
   `array_positions(array, element, Option<index>)` that able us to find all 
the elements start from `index`.
   
   # Proposal 2 Introduce `array_position_n`
   `array_position(array, element, Option<index>)` that able us to find 1 
element start from `index`.
   `array_position_n(array, element, n, Option<index>)` that able us to find n 
elements start from `index`.
   `array_positions(array, element, Option<index>)` that able us to find all 
the elements start from `index`.
   
   I think either of two are good for me, so I would like to collect feedbacks 
from yours.
   
   # Others than PostgreSQL
   ## Duckdb
   `list_position(list, element)` only has the basic one.
   
   ## Clickhouse
   None
   
   
   ### Describe the solution you'd like
   
   Extend `array_position`
   
   ### Describe alternatives you've considered
   
   Keep it as it is.
   
   ### Additional context
   
   _No response_


-- 
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