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

Rechunk parameter not respected using read_parquet #8932

Closed
2 tasks done
jfinkle1016 opened this issue May 19, 2023 · 3 comments
Closed
2 tasks done

Rechunk parameter not respected using read_parquet #8932

jfinkle1016 opened this issue May 19, 2023 · 3 comments
Labels
bug Something isn't working python Related to Python Polars

Comments

@jfinkle1016
Copy link

Polars version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of Polars.

Issue description

When reading in a parquet the rechunk parameter is not respected.

Reproducible example

import numpy as np
import polars as pl
from pyarrow.parquet import read_metadata

a = np.random.random((200, 5))
# We expect there to be fifty chunks
pl.DataFrame(a).write_parquet('tmp.pq', row_group_size=4)

# Should output `num_row_groups: 50`
print(read_metadata('tmp.pq'))

df = pl.read_parquet('tmp.pq', rechunk=True)

# We expect 1 but we get 50
print(df.n_chunks())

# We expect 1 and get 1
print(df.rechunk().n_chunks())

Expected behavior

import numpy as np
import polars as pl
from pyarrow.parquet import read_metadata

a = np.random.random((200, 5))
# We expect there to be fifty chunks
pl.DataFrame(a).write_parquet('tmp.pq', row_group_size=4)

# Should output `num_row_groups: 50`
print(read_metadata('tmp.pq'))

df = pl.read_parquet('tmp.pq', rechunk=True)

# We expect 1 but we get 50
print(df.n_chunks())

# We expect 1 and get 1
print(df.rechunk().n_chunks())

Installed versions

--------Version info---------
Polars:      0.17.14
Index type:  UInt32
Platform:    Linux-5.15.0-1031-aws-x86_64-with-glibc2.31
Python:      3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03) 
[GCC 11.3.0]

----Optional dependencies----
numpy:       1.23.4
pandas:      1.5.1
pyarrow:     10.0.1
connectorx:  <not installed>
deltalake:   <not installed>
fsspec:      2022.11.0
matplotlib:  3.7.1
xlsx2csv:    <not installed>
xlsxwriter:  <not installed>
@jfinkle1016 jfinkle1016 added bug Something isn't working python Related to Python Polars labels May 19, 2023
@jfinkle1016
Copy link
Author

@myz540 for visibility

@ritchie46
Copy link
Member

fixed by #8935

@jfinkle1016
Copy link
Author

Amazing. Thanks for the fast turn around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

2 participants