-
Notifications
You must be signed in to change notification settings - Fork 274
fix upsert
with null values
#1861
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 upsert
with null values
#1861
Conversation
Thanks for looking into this @kevinjqliu, pretty annoying null-handling here :/ |
now im wondering if nulls are properly handled when we convert iceberg expressions to pyarrow expressions iceberg-python/pyiceberg/io/pyarrow.py Lines 721 to 725 in 1a5e32a
https://arrow.apache.org/docs/python/generated/pyarrow.compute.equal.html
|
I think we need to check the Edit: I think that situation is different since we're comparing two columns in the Upsert logic. For the visitor that you linked, we compare against a literal. |
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change Closes #1835 Original implementation, `!=` ([not_equal](https://arrow.apache.org/docs/python/generated/pyarrow.compute.not_equal.html#pyarrow.compute.not_equal)) does not account for `null` values. It emits `null` when either sides are `null` The new implementation, first checks for `not_equal`. And on null values, returns `true` only if both sides are `null` Similar to apache/iceberg-rust#1045 # Are these changes tested? Yes # Are there any user-facing changes? No <!-- In the case of user-facing changes, please add the changelog label. -->
Rationale for this change
Closes #1835
Original implementation,
!=
(not_equal) does not account fornull
values. It emitsnull
when either sides arenull
The new implementation, first checks for
not_equal
. And on null values, returnstrue
only if both sides arenull
Similar to apache/iceberg-rust#1045
Are these changes tested?
Yes
Are there any user-facing changes?
No