-
Notifications
You must be signed in to change notification settings - Fork 435
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
PARQUET-2139: Deprecate ColumnChunk::file_offset field #440
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -867,12 +867,21 @@ struct ColumnChunk { | |
**/ | ||
1: optional string file_path | ||
|
||
/** Byte offset in file_path to the ColumnMetaData **/ | ||
2: required i64 file_offset | ||
/** Deprecated: Byte offset in file_path to the ColumnMetaData | ||
* | ||
* Past use of this field has been inconsistent, with some implementations | ||
* using it to point to the ColumnMetaData and some using it to point to | ||
* the first page in the column chunk. In many cases, the ColumnMetaData at this | ||
* location is wrong. This field is now deprecated and should not be used. | ||
* Writers should set this field to 0 if no ColumnMetaData has been written outside | ||
* the footer. | ||
*/ | ||
2: required i64 file_offset = 0 | ||
|
||
/** Column metadata for this chunk. This is the same content as what is at | ||
* file_path/file_offset. Having it here has it replicated in the file | ||
* metadata. | ||
/** Column metadata for this chunk. Some writers may also replicate this at the | ||
* location pointed to by file_path/file_offset. | ||
* Note: while marked as optional, this field is in fact required by most major | ||
* Parquet implementations. As such, writers MUST populate this field. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
**/ | ||
3: optional ColumnMetaData meta_data | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I don't understand would set a required field to 0 is ok and would it cracks the legacy reader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, required fields are allowed to have default values (see this for some messy details). I looked at code generated by thrift 0.21.0. Java and c++ set the field to the default value in the default constructor, and write the field regardless of its value. The generated rust code doesn't appear to set the default value, however.
It is conceivable that there is a thrift implementation that would not write the '0', which would then break an old reader that expects the field to be set. Maybe I should revert setting a default. @alkis what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required by the thrift spec.
From https://thrift.apache.org/docs/idl#required:
In any case leaving this with a default of 0 doesn't hurt. Java and C++ can stop populating this field as soon as they pick up the new thrift IDL. Rust cannot stop populating because its thrift implementation is broken. When its fixed, it can also simplify.