Skip to content

Commit

Permalink
Add LIKE expr support
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov committed Jul 24, 2024
1 parent b045511 commit 0ae743f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sql/sql_provider_datafusion/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ pub fn to_sql_with_engine(expr: &Expr, engine: Option<Engine>) -> Result<String>
expr: format!("{expr}"),
}),
},
Expr::Like(like_expr) => {
let expr = to_sql_with_engine(&like_expr.expr, engine)?;
let pattern = to_sql_with_engine(&like_expr.pattern, engine)?;
let op_name = if like_expr.negated {
"NOT LIKE"
} else {
"LIKE"
};
Ok(format!("{expr} {op_name} {pattern}"))
},
_ => Err(Error::UnsupportedFilterExpr {
expr: format!("{expr}"),
}),
Expand Down

0 comments on commit 0ae743f

Please sign in to comment.