wgtmac commented on code in PR #41550:
URL: https://github.com/apache/arrow/pull/41550#discussion_r1591718431
##########
cpp/src/parquet/file_reader.cc:
##########
@@ -373,6 +373,7 @@ class SerializedFile : public ParquetFileReader::Contents {
void set_metadata(std::shared_ptr<FileMetaData> metadata) {
file_metadata_ = std::move(metadata);
+ file_decryptor_ = file_metadata_->file_decryptor();
Review Comment:
https://github.com/apache/arrow/blob/main/cpp/src/parquet/file_reader.cc#L775-L780
I think these are in two different directions while opening a parquet
reader:
- For `ParseXXX` functions where we parse footer to create `file_decryptor_`
and `file_metadata_`. We need to set `file_decryptor_` to `file_metadata_` so
that both `SerializedFile` and `FileMetaData` have a copy of the decryptor.
- For `set_metadata` function, we already have the cached `FileMetaData` but
need to create `SerializedFile` where its `file_decryptor_` is null. Therefore
we need to get `file_decryptor_` from `file_metadata_`.
Does that make sense?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]