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

slice is not respected in the sense that apparently the whole file is loaded first. This results for me in OOM and a longer than expected time. #16066

Open
2 tasks done
zbenmo opened this issue May 5, 2024 · 0 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@zbenmo
Copy link

zbenmo commented May 5, 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

%%time

df = (
    pl.scan_parquet('/kaggle/input/leash-BELKA/train.parquet')
    [157:169]
    .collect()
)

Log output

No response

Issue description

Trying to load specific rows from a big parquet file.

With parquet as above, I get OOM exception, after a long time passes.
With scan_csv of the matching file seems to work fine.

Expected behavior

As I indicate the slice, and it can be potentially used to optimize and read only a small portion of the file, I would be happy if this is indeed what happened.

Installed versions

--------Version info---------
Polars:               0.20.21
Index type:           UInt32
Platform:             Linux-5.15.133+-x86_64-with-glibc2.31
Python:               3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39) [GCC 12.3.0]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          2.2.1
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               2024.2.0
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           3.7.5
nest_asyncio:         1.5.8
numpy:                1.26.4
openpyxl:             3.1.2
pandas:               2.2.2
pyarrow:              15.0.2
pydantic:             2.5.3
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           2.0.25
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@zbenmo zbenmo added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

1 participant