-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Coerce and simplify FixedSizeBinary equality to literal binary #15726
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
Coerce and simplify FixedSizeBinary equality to literal binary #15726
Conversation
c56e280 to
c72a478
Compare
|
I now realize I the |
|
cc @jayzhan211, could I ask you for a review? |
jayzhan211
left a comment
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.
👍🏻
alamb
left a comment
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.
Looks good -- thank you @leoyvens and @jayzhan211
I pushed one more slt test that verifies the cast is removed via an EXPLAIN. This is a very nice improvement I think
| } | ||
| (Binary, Utf8) | (Utf8, Binary) => Some(Binary), | ||
|
|
||
| // Cast FixedSizeBinary to Binary |
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.
As a follow on PR it might be good to also support BinaryView as well
…e#15726) * coerce FixedSizeBinary to Binary * simplify FixedSizeBytes equality to literal * fix clippy * remove redundant ExprSimplifier case * Add explain test to make sure unwrapping is working correctly --------- Co-authored-by: Andrew Lamb <[email protected]>
Which issue does this PR close?
Rationale for this change
See #15686 (comment).
What changes are included in this PR?
The two initial commits have two sequential changes:
FixedSizeBinarytoBinarywhen necessary, as we already do for lists.ExprSimplifierto optimize away the coercion cast when comparing to a literal.Are these changes tested?
There is an
.slttest. An existing one that previously failed to coerce will now evaluate the comparison.Are there any user-facing changes?
No, this should be very transparent.