[PyArrow] Filter Pushdown of IS IN now uses the dedicated pyarrow.compure.Expression.isin method#73
Closed
Tishj wants to merge 2 commits intoduckdb:v1.4-andiumfrom
Closed
[PyArrow] Filter Pushdown of IS IN now uses the dedicated pyarrow.compure.Expression.isin method#73Tishj wants to merge 2 commits intoduckdb:v1.4-andiumfrom
IS IN now uses the dedicated pyarrow.compure.Expression.isin method#73Tishj wants to merge 2 commits intoduckdb:v1.4-andiumfrom
Conversation
|
Trying to pick this up. It seems expected behavior is a null result whenever |
Collaborator
|
Closing in favor of #335 |
evertlammerts
added a commit
that referenced
this pull request
Feb 20, 2026
…pure.Expression.isin method (#335) Continued from #73 Null handling seems to work fine, afaics. We are using [`Expression.isin()`](https://arrow.apache.org/docs/python/generated/pyarrow.dataset.Expression.html#pyarrow.dataset.Expression.isin), which does not have a `skipp_nulls` kwarg. It uses the same default semantics as [`pyarrow.compute.is_in`](https://arrow.apache.org/docs/python/generated/pyarrow.compute.is_in.html#pyarrow.compute.is_in), which is `skip_nulls = False`. This is not exactly the same as duckdb's semantics, because DuckDB will not return NULL values even if NULL is in the IN list: ``` D select * from VALUES(1), (2), (3), (NULL) as t(myint) where myint in (2, NULL); ┌───────┐ │ myint │ │ int32 │ ├───────┤ │ 2 │ └───────┘ ``` But this is no big deal. We might let more rows through than is needed, but duckdb will filter them out anyway. Also see the test.
This file contains hidden or 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
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.
This PR fixes #52
There's some fumbling with null-handling that should be checked
The docs of pyarrow say it takes an
skip_nulls: Optional[bool] = Nonekwarg, but in reality it doesn't do that on v20https://arrow.apache.org/docs/python/generated/pyarrow.compute.is_in.html#
Marking this as draft because the null handling needs to be looked into
There is already a test,
test_in_filter_pushdownbut it's quite limited