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

[FEA] Support dictionary compression with up to 32 bits for Parquet writer #10948

Closed
beckernick opened this issue May 24, 2022 · 2 comments · Fixed by #11216
Closed

[FEA] Support dictionary compression with up to 32 bits for Parquet writer #10948

beckernick opened this issue May 24, 2022 · 2 comments · Fixed by #11216
Assignees
Labels
cuIO cuIO issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code.

Comments

@beckernick
Copy link
Member

beckernick commented May 24, 2022

Currently, the parquet writer has a 16 bit maximum dictionary size.

// Total number of unsigned 16 bit values
constexpr size_type MAX_DICT_SIZE =
std::numeric_limits<uint16_t>::max() - std::numeric_limits<uint16_t>::min() + 1;

This means that within a column chunk, if there are <= 65535 unique entries, we can use dictionary based compression to potentially save space. However, if there are > 65535 unique entries we can't use dictionary compression, potentially leading to larger file sizes.

The Apache Parquet format specification indicates support for a 32 bit maximum width, and this is available in the official Java implementation of Parquet.

Some users have shared that using libcudf instead of the traditional Java Parquet implementation has resulted in file sizes >5x larger in some scenarios (due to not being able to use dictionary encoding), which can pose a storage challenge at scale.

@beckernick beckernick added feature request New feature or request cuda libcudf Affects libcudf (C++/CUDA) code. cuIO cuIO issue labels May 24, 2022
@beckernick
Copy link
Member Author

Per offline discussion, 24 bits would be sufficient for known use cases. cc @devavret @vuule

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

rapids-bot bot pushed a commit that referenced this issue Jul 21, 2022
Closes #10948 

Adds support for dictionary encoding with 24 bit indices.

Authors:
  - Devavret Makkar (https://github.com/devavret)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Vukasin Milovanovic (https://github.com/vuule)

URL: #11216
rapids-bot bot pushed a commit that referenced this issue Sep 26, 2022
Allows use of any bit width from 1 to 24 for Parquet dictionary keys.  Also removes some more magic numbers and cleans up the dictionary test code.  Finishes off changes for  #10948.

Authors:
  - Ed Seidl (https://github.com/etseidl)

Approvers:
  - https://github.com/nvdbaranec
  - Vukasin Milovanovic (https://github.com/vuule)

URL: #11580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuIO cuIO issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants