-
Notifications
You must be signed in to change notification settings - Fork 600
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
fix(snowflake): make semantics of array filtering match everything else #10469
Merged
cpcloud
merged 2 commits into
ibis-project:main
from
cpcloud:null-handling-array-filter-clouds
Nov 11, 2024
Merged
fix(snowflake): make semantics of array filtering match everything else #10469
cpcloud
merged 2 commits into
ibis-project:main
from
cpcloud:null-handling-array-filter-clouds
Nov 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpcloud
added
bug
Incorrect behavior inside of ibis
snowflake
The Snowflake backend
labels
Nov 11, 2024
Snowflake is passing:
|
cpcloud
commented
Nov 11, 2024
if index is None: | ||
return self.f.filter(arg, sge.Lambda(this=body, expressions=[param])) | ||
else: |
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.
There are no changes here except dedenting.
cpcloud
force-pushed
the
null-handling-array-filter-clouds
branch
from
November 11, 2024 13:07
f5e3a8a
to
6d90f18
Compare
Snowflake passing after most recent force push:
|
Merging to get CI green again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes snowflake failures on
main
, caused by slightly different behavior aroundNULL
s used in array filtering.This PR ensures that behavior is the same for all backends that support array
filtering with an index.
Snowflake is a bit more complex because its higher order functions only accept
a single argument, so before we compile we run a rewrite rule (the use of
a rewrite is not new in this PR) to extract the field being referenced in
the body of the function.
The changes here are only relevant for the case of array filtering with an
index. If an index isn't used, then the behavior is the same as before.
This changes here are effectively making the snowflake backend implement array
filtering with an index like Trino and PySpark, where we construct a struct
containing whether to keep a value or not, along with the value.
This allows preservation of
NULL
values when the index is used for filtering,for example.