Add periodic Parquet file merging by time period#9
Merged
Conversation
- Add merge configuration to SinkConfig (merge_enabled, merge_period, merge_min_files, merge_on_flush) - Add merge_files() method to DataSink interface - Implement merge_files() in LocalSink, S3Sink, and HDFSSink - Handle dictionary encoding issues when merging Parquet files - Add comprehensive tests for merge functionality - Update documentation with merge configuration examples - Add environment variable support for merge settings Co-authored-by: slhmy <31381093+slhmy@users.noreply.github.com>
Co-authored-by: slhmy <31381093+slhmy@users.noreply.github.com>
- Fix Python 3.9 compatibility: use os.walk() instead of Path.walk() - Add comprehensive documentation for dictionary encoding decision in merge methods - Improve docstrings to explain merge behavior and schema compatibility handling Co-authored-by: slhmy <31381093+slhmy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Merge Parquet files periodically based on configured period
Add periodic Parquet file merging by time period
Nov 13, 2025
Contributor
|
Fix format and lint issues @copilot |
Run black formatter on sink files to fix formatting issues: - src/fs_data_sink/sinks/local_sink.py - src/fs_data_sink/sinks/hdfs_sink.py - src/fs_data_sink/sinks/s3_sink.py Co-authored-by: slhmy <31381093+slhmy@users.noreply.github.com>
Contributor
Author
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.
Periodic Parquet File Merging Implementation
Implemented feature to periodically merge small Parquet files into larger consolidated files by configured time periods (hourly, daily, weekly, monthly).
Changes Made:
Add configuration options for merge settings
merge_enabled: Enable/disable file mergingmerge_period: Time-based merge interval (hour, day, week, month)merge_min_files: Minimum number of files to trigger a mergemerge_on_flush: Merge files during flush operationsCreate merge functionality
merge_files()method to DataSink interfaceIntegrate into pipeline
Add comprehensive tests (11 new tests)
Update documentation
Code quality
Key Features:
✅ Flexible Time Periods: Merge by hour, day, week, or month
✅ Minimum File Threshold: Only merge when enough files exist
✅ Partitioning Support: Works with partitioned data
✅ Multi-Storage: Works with S3, HDFS, and local filesystems
✅ Schema Compatibility: Handles dictionary encoding in Parquet files
✅ Automatic Cleanup: Deletes original files after merge
✅ Python 3.9+ Compatible: Uses os.walk() for broad compatibility
Benefits:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.