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

Projection pushdown with hive partitions may not be respected #17104

Closed
2 tasks done
nameexhaustion opened this issue Jun 21, 2024 · 2 comments · Fixed by #17152
Closed
2 tasks done

Projection pushdown with hive partitions may not be respected #17104

nameexhaustion opened this issue Jun 21, 2024 · 2 comments · Fixed by #17152
Assignees
Labels
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

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
from pathlib import Path


root = Path(".env/data2")

dfs = [
    pl.DataFrame({"x": 1}),
    pl.DataFrame({"x": 2}),
]

paths = [
    root / "a=1/b=1/data.bin",
    root / "a=2/b=2/data.bin",
]

[
    [paths[i].parent.mkdir(exist_ok=True, parents=True), dfs[i].write_parquet(paths[i])]
    for i in range(len(dfs))
]

lf = pl.scan_parquet(root / "**/*.bin")
lf = lf.select("x", "a")

print(lf.collect())

Observe the select was not respected:

shape: (2, 3)
┌─────┬─────┬─────┐
│ xab   │
│ --------- │
│ i64i64i64 │
╞═════╪═════╪═════╡
│ 111   │
│ 222   │
└─────┴─────┴─────┘

Log output

No response

Issue description

#15573 removes the projection node after projection pushdown into the parquet reader, which reveals that the parquet reader was not applying the projection properly on the hive partition columns.

Expected behavior

shape: (2, 2)
┌─────┬─────┐
│ xa   │
│ ------ │
│ i64i64 │
╞═════╪═════╡
│ 11   │
│ 22   │
└─────┴─────┘

Installed versions

main @ 8a6bf4b

@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 labels Jun 21, 2024
@nameexhaustion nameexhaustion self-assigned this Jun 21, 2024
@github-project-automation github-project-automation bot moved this to Ready in Backlog Jun 21, 2024
@nameexhaustion nameexhaustion changed the title Projection pushdown with hive partitions is partially broken Projection pushdown with hive partitions may not be respected Jun 21, 2024
@deanm0000
Copy link
Collaborator

duplicate of this I put some notes in there that might be helpful.

@nameexhaustion
Copy link
Collaborator Author

duplicate of this I put some notes in there that might be helpful.

Thanks for the triage!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
2 participants