alamb commented on a change in pull request #508:
URL: https://github.com/apache/arrow-datafusion/pull/508#discussion_r647307669
##########
File path: datafusion/src/physical_optimizer/pruning.rs
##########
@@ -586,8 +587,47 @@ fn build_predicate_expression(
.min_column_expr()?
.lt_eq(expr_builder.scalar_expr().clone())
}
+ Operator::Like => {
+ match &**right {
+ // If the literal is a 'starts_with'
+ Expr::Literal(ScalarValue::Utf8(Some(string)))
+ if !string.starts_with('%') =>
+ {
+ // Split the string to get the first part before '%'
+ let split = string.split('%').next().unwrap().to_string();
Review comment:
I initially wondered the same thing -- lol! But my conclusion was "no it
won't panic"
I made a quick playground that shows this working
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=049f4c1640386ff99c3b5e07085e0889
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]