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

smarter, faster, more memory-efficient, lazy pivot #2374

Open
jqnatividad opened this issue Dec 24, 2024 · 0 comments
Open

smarter, faster, more memory-efficient, lazy pivot #2374

jqnatividad opened this issue Dec 24, 2024 · 0 comments
Labels
enhancement New feature or request. Once marked with this label, its in the backlog. performance polars
Milestone

Comments

@jqnatividad
Copy link
Collaborator

jqnatividad commented Dec 24, 2024

Even though we load the CSV in lazy mode (primarily to faciltate date inferencing with --try-parsedates and --infer-len), pivotp currently uses Polars' eager mode to do the pivot.

https://docs.pola.rs/user-guide/concepts/lazy-api/

https://github.com/pola-rs/polars/blob/9ea5839c52bf0606aaa0b174d9a974992e0ea328/crates/polars-ops/src/frame/pivot/mod.rs#L119-L153

Since we already use the stats-cache to do pivot validation and smart aggregation, use the stats cache to infer a polars schema as well and do the pivot using the Lazy API's group by method instead.

@jqnatividad jqnatividad added enhancement New feature or request. Once marked with this label, its in the backlog. polars performance labels Dec 24, 2024
@jqnatividad jqnatividad changed the title smarter, faster, lazy pivot smarter, faster, more memory-efficient, lazy pivot Dec 24, 2024
@jqnatividad jqnatividad added this to the v3.0 milestone Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request. Once marked with this label, its in the backlog. performance polars
Projects
None yet
Development

No branches or pull requests

1 participant