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

   ### Is your feature request related to a problem or challenge?
   
   @adriangb  implemented `PruningPredicate` support for prefix matching `LIKE` 
/ `NOT LIKE` in 
   - https://github.com/apache/datafusion/pull/12978
   
   However, it isn't currently supported for the `starts_with` function 
   
   ### Describe the solution you'd like
   
   I would like predicate pruning to happen for the `starts_with` function as 
well
   
   So queries like
   ```sql
   select * from my_file where starts_with(col, 'http://')
   ```
   
   Could also use starts_with to prune parquet files
   
   ### Describe alternatives you've considered
   
   The challenge at the moment is that `PruningPredicate` can't refer directly 
to the function implementations 
   
   Given how optimized LIKE is one possible solution would be to change 
`starts_with` so it didn't just call an arrow kernel, but instead was rewritten 
   
   
https://github.com/apache/datafusion/blob/main/datafusion/functions/src/string/starts_with.rs
   
   So for example, it could be rewritten into 
[`Expr::Like`](https://docs.rs/datafusion/latest/datafusion/prelude/enum.Expr.html#variant.Like)
 by implementing `simplity`: 
   
   
https://docs.rs/datafusion/latest/datafusion/logical_expr/trait.ScalarUDFImpl.html#method.simplify
   
   
   We could do something similar with `ends_with` as well
   
   ### 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: github-unsubscr...@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to