Skip to content

Commit

Permalink
apacheGH-43427: Parquet Deprecate ColumnChunk::file_offset field
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Jul 26, 2024
1 parent f54b120 commit ddd5f16
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/src/parquet/metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,11 @@ class ColumnChunkMetaDataBuilder::ColumnChunkMetaDataBuilderImpl {
const std::shared_ptr<Encryptor>& encryptor) {
if (dictionary_page_offset > 0) {
column_chunk_->meta_data.__set_dictionary_page_offset(dictionary_page_offset);
column_chunk_->__set_file_offset(dictionary_page_offset + compressed_size);
} else {
column_chunk_->__set_file_offset(data_page_offset + compressed_size);
}
// https://github.com/apache/parquet-format/pull/440
// The `file_offset` field is deprecated and should be set to 0 for writer
// if the column chunk has not been written outsidethe footer.
column_chunk_->__set_file_offset(0);
column_chunk_->__isset.meta_data = true;
column_chunk_->meta_data.__set_num_values(num_values);
if (index_page_offset >= 0) {
Expand Down

0 comments on commit ddd5f16

Please sign in to comment.