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

   ### Is your feature request related to a problem or challenge?
   
   The idea is to support the `position` function from postgres:
   
   https://www.postgresql.org/docs/9.1/functions-string.html
   
   ```sql
   position(substring in string)        
   ```
   
   For example
   ```sql
   postgres=# select position('world' in 'Helloworld');
    position
   ----------
           6
   (1 row)
   ```
   
   ### Describe the solution you'd like
   
   As @zy-kkk points out on 
https://github.com/apache/arrow-datafusion/pull/8862#issuecomment-1906262994 
postgres has special syntax 
   
   To support the syntax `position('world' in 'Helloworld') = 6` we probably 
need to do it in at https://github.com/sqlparser-rs/sqlparser-rs and add 
support for this syntax , which may be like adding the `overlay` function in 
https://github.com/sqlparser-rs/sqlparser-rs/pull/594. 
   
   Then we can change the datafusion planner to recognize that special syntax 
and call the `instr` function in 
https://github.com/apache/arrow-datafusion/pull/8862
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   This came up while implementing 
https://github.com/apache/arrow-datafusion/pull/8862


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