Uh oh!
There was an error while loading. Please reload this page.
Expand LIKE simplification: cover NULL pattern/expression and constant - #13260
Conversation
c6285bf to
be26107Comparefindepi
commented
Nov 5, 2024
currently depends on #13259 |
findepi
commented
Nov 5, 2024
findepi
commented
Nov 5, 2024
seemed easy enough, done. |
88d6df1 to
6c57af7Compareadriangb
commented
Nov 5, 2024
I’m happy with my changes being included in this PR :) |
findepi
commented
Nov 5, 2024
draft - to be rebased after #13259 lands still ready to review |
goldmedal
left a comment
There was a problem hiding this comment.
Just roughly review now. Overall looks to me. I will check the test cases tomorrow.
Uh oh!
There was an error while loading. Please reload this page.
goldmedal
commented
Nov 6, 2024
#13259 has been merged. 👍 |
e4eae46 to
520ad2bComparefindepi
commented
Nov 6, 2024
@goldmedal rebased, thanks! |
alamb
left a comment
There was a problem hiding this comment.
Thank you @findepi and @goldmedal
This looks like a great change to me except for the handling of %% which I am not sure about. Otherwise 👍
| } | ||
| fn like(expr: Expr, pattern: &str) -> Expr { | ||
| fn like(expr: Expr, pattern: impl Into<Expr>) -> Expr { |
There was a problem hiding this comment.
I think we could use Expr::like https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.Expr.html#method.like and similar here instead of these functions
This is likely left over from when the Expr API was less expressive
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
NULL pattern/expression and constantUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
crepererum
commented
Nov 6, 2024
since there are already two reviewers on it, I'll gonna skip this PR. However if you need my input, ping me. |
alamb
left a comment
There was a problem hiding this comment.
Thank you @findepi and @goldmedal
I had some small testing suggestions but I think we can add that coverage as a follow on PR as well
Uh oh!
There was an error while loading. Please reload this page.
findepi
commented
Nov 7, 2024
FYI, when testing LIKE patterns with potential escapes, beware of difference between sqllogictests and CLI when it comes to backslash (like implicit escape) -- #13286 |
Uh oh!
There was an error while loading. Please reload this page.
Looks like this branch has some conflicts now to resolve but then I think it will be ready to go |
- cover expression known not to be null - cover NULL pattern - cover repeated '%%' in pattern
findepi
commented
Nov 8, 2024
The conflicts are because #13288 is now merged. Let me rebase. |
e05417a to
5a03823Comparefindepi
commented
Nov 8, 2024
(just rebased) |
findepi
commented
Nov 8, 2024
Applied comments and fixed handling of implicit escape. |
alamb
commented
Nov 8, 2024
Thanks @findepi@adriangb and @goldmedal for this PR and the reviews |
…ant (apache#13260) * Expand LIKE simplification - cover expression known not to be null - cover NULL pattern - cover repeated '%%' in pattern * Simplify `EXPR LIKE 'constant'` to `expr = 'constant'` * Correctness and style fixes * fix typo --------- Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
EXPR LIKE 'constant'toexpr = 'constant'#13061 to resolve conflicts