alamb commented on code in PR #3101:
URL: https://github.com/apache/arrow-datafusion/pull/3101#discussion_r967143108
##########
datafusion/sql/src/planner.rs:
##########
@@ -1939,30 +1939,52 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
}
SQLExpr::Like { negated, expr, pattern, escape_char } => {
- match escape_char {
- Some(_) => {
- // to support this we will need to introduce
`Expr::Like` instead
- // of treating it like a binary expression
- Err(DataFusionError::NotImplemented("LIKE with ESCAPE
is not yet supported".to_string()))
- },
- _ => {
- Ok(Expr::BinaryExpr {
- left:
Box::new(self.sql_expr_to_logical_expr(*expr, schema, ctes)?),
- op: if negated { Operator::NotLike } else {
Operator::Like },
- right:
Box::new(self.sql_expr_to_logical_expr(*pattern, schema, ctes)?),
- })
- }
+ let pattern = self.sql_expr_to_logical_expr(*pattern, schema,
ctes)?;
+ let pattern_type = pattern.get_type(schema)?;
+ if pattern_type != DataType::Utf8 && pattern_type !=
DataType::Null {
Review Comment:
👍
--
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]