-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand LIKE simplification #13260
base: main
Are you sure you want to change the base?
Expand LIKE simplification #13260
Conversation
`expr LIKE '%'` was previously simplified to `true`, but the expression returns `NULL` when `expr` is null. The conversion was conditional on `!is_null(expr)` which means "is not always true, i.e. is not a null literal". This commit adds correct simplification logic. It additionally expands the rule coverage to include string view (Utf8View) and large string (LargeUtf8). This allows writing shared test cases even despite `utf8_view LIKE '%'` returning incorrect results at execution time (tracked by apache#12637). I.e. the simplification masks the bug for cases where pattern is statically known.
- cover expression known not to be null - cover NULL pattern - cover repeated '%%' in pattern
c6285bf
to
be26107
Compare
currently depends on #13259 |
seemed easy enough, done. |
88d6df1
to
6c57af7
Compare
I’m happy with my changes being included in this PR :) |
draft - to be rebased after #13259 lands still ready to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just roughly review now. Overall looks to me. I will check the test cases tomorrow.
#13259 has been merged. 👍 |
EXPR LIKE 'constant'
toexpr = 'constant'
#13061 to resolve conflicts