-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. | ||
Comment on lines
+876
to
+877
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. 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 commentThe 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 commentThe 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. |
||
*/ | ||
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 | ||
|
||
|
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.
Hmm why this is Page Metadata? It's a bit confusing for me, since from ColumnChunk, we may not get the details of the page internal (like how many pages we have?)
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.
I switched it for two reasons. First was a comment @julienledem made. The second is that since the following section on metadata now states there are two types of metadata (file metadata and page header metadata), both should appear in the diagram. Perhaps the diagram should say "Page Header Metadata", or just omit all mention of metadata and simply have
<Column 1 Chunk 1>
. I don't have a strong preference beyond it should no longer show "Column Metadata".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.
There is no bijection between column chunks and page headers, so I find this highly misleading.
You could make it "Optional Column Metadata" if you want stress that it's not always there, or you could indeed omit it if it's not an important feature anymore.
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.
Since the following diagram makes clear that a column chunk is a collection of pages, and pages include the page header, I'm fine with omitting all mention of metadata here.