Skip to content
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

Predicates with & where one side is is_in(Series) are no longer pushed down to pyarrow scan #18141

Closed
2 tasks done
nameexhaustion opened this issue Aug 12, 2024 · 1 comment · Fixed by #18145
Closed
2 tasks done
Assignees
Labels
A-optimizer Area: plan optimization accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars regression Issue introduced by a new release

Comments

@nameexhaustion
Copy link
Collaborator

nameexhaustion commented Aug 12, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl
import pyarrow.dataset as ds

path = ".env/data.parquet"
pl.DataFrame({"x": 1}).write_parquet(path)
lf = pl.scan_pyarrow_dataset(ds.dataset(path))

print(lf.filter(pl.col("x").is_in([2])).explain())
# PYTHON SCAN []
# PROJECT */1 COLUMNS
# SELECTION: col("x").is_in([Series])
print(8 * "=")
print(lf.filter((pl.col("x") == 1) | (pl.col("x").is_in([2]))).explain())
# FILTER [([(col("x")) == (1)]) | (col("x").is_in([Series]))] FROM
#   PYTHON SCAN []
#   PROJECT */1 COLUMNS

Log output

No response

Issue description

This is due to a combination of https://github.com/pola-rs/polars/pull/17939/files#diff-e1f991b2a947bfb3c1d98696b1256362ee233eef35b8a86715e4eabceeb46b02 and the expression not being considered streamable

ref #17045 (comment)

Expected behavior

The 2nd query should also push the predicate into a SELECTION at scan

Installed versions

main / 1.4.1

@nameexhaustion nameexhaustion added bug Something isn't working python Related to Python Polars regression Issue introduced by a new release accepted Ready for implementation P-medium Priority: medium A-optimizer Area: plan optimization labels Aug 12, 2024
@ritchie46
Copy link
Member

Ah, right. That's due to IO source. I can take this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-optimizer Area: plan optimization accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars regression Issue introduced by a new release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants