Repository navigation
fix(table): use proper data file names - #702
Merged
Merged
Conversation
ferhatelmas
reviewed
Jan 28, 2026
ferhatelmas
reviewed
Jan 28, 2026
ferhatelmas
reviewed
Jan 28, 2026
ferhatelmas
reviewed
Jan 28, 2026
ferhatelmas
reviewed
Jan 28, 2026
ferhatelmas
reviewed
Jan 28, 2026
kevinjqliu
approved these changes
Jan 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes data file naming to properly track partition IDs and file counts instead of using hardcoded "00000" values. The implementation follows the Java Iceberg reference to generate spec-compliant file names with the format {partitionId:05d}-{taskId}-{operationId}-{fileCount:05d}.{extension}.
Changes:
- Updated
WriteTaskstruct to includePartitionIDandFileCountfields for proper file naming - Modified
GenerateDataFileNameto use the new fields in the correct format with proper padding - Added comprehensive unit tests for file name generation covering various scenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| table/writer_test.go | Added comprehensive unit tests for data file name generation with various partition and file count scenarios |
| table/writer.go | Updated WriteTask struct with PartitionID and FileCount fields; modified GenerateDataFileName to use proper format string |
| table/rolling_data_writer.go | Added partition ID counter to writerFactory and file counter to RollingDataWriter; updated WriteTask creation to populate new fields |
| table/arrow_utils.go | Updated unpartitioned write path to use UnpartitionedSpec.ID() for PartitionID and track file count; extracted magic number to named constant |
| internal/utils.go | Modified Counter function to use atomic operations for thread-safety (but has a race condition issue) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
rockwotj
pushed a commit
to rockwotj/iceberg-go
that referenced
this pull request
Mar 18, 2026
fixes apache#697 Follows the same standard as the java implementation to generate data file names appropriately. Adds a test to confirm the name generation. --------- Co-authored-by: Copilot <[email protected]>
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.
fixes #697
Follows the same standard as the java implementation to generate data file names appropriately.
Adds a test to confirm the name generation.