Add parquet row group size and sorting capabilities to writers#419
Merged
Add parquet row group size and sorting capabilities to writers#419
Conversation
Co-authored-by: joocer <1688479+joocer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add a feature to the writer that allows us to set the parquet row group size (default to 5,000 rows) and can order the records (default to the append order, but allow us to sort pre-commit)
Add parquet row group size and sorting capabilities to writers
Oct 3, 2025
joocer
approved these changes
Oct 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds two new features to the mabel writer for better control over parquet file generation:
Motivation
Large parquet files benefit from optimized row group sizes and sorted data:
These features allow users to optimize parquet files for their specific use cases without post-processing.
Changes
Modified
mabel/data/writers/internals/blob_writer.pyparquet_row_group_size: int = 5000parameter to control row group sizesort_by: Optional[str] = Noneparameter to enable pre-commit sortingcommit()method to:pytable.sort_by()whensort_byis specifiedrow_group_sizetopyarrow.parquet.write_table()Added
tests/test_writer_parquet_features.pyComprehensive test suite covering:
Usage
Implementation Notes
blob_writer.py)Writer,BatchWriter, andStreamWritervia**kwargspropagationTesting
All tests pass successfully:
Total: 23/23 tests passed
Integration testing validated:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.