You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2024/05/06 15:44:27 UTC
[PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
wgtmac opened a new pull request, #41550:
URL: https://github.com/apache/arrow/pull/41550
### Rationale for this change
When parquet dataset is reused to create multiple scanners, `FileMetaData` objects are cached to avoid parsing them again. However, these caused issues on encrypted files since internal file decryptors were no longer created by cached `FileMetaData` objects.
### What changes are included in this PR?
Expose file_decryptor from FileMetaData and set it properly.
### Are these changes tested?
Yes, modify the test to reproduce the issue and assure fixed.
### Are there any user-facing changes?
No.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2099767633
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 53859262ea988f31ce33a469305251064b5a53b8.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/24713731776) has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on code in PR #41550:
URL: https://github.com/apache/arrow/pull/41550#discussion_r1591996714
##########
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:
Good question! Let me consolidate them.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac merged PR #41550:
URL: https://github.com/apache/arrow/pull/41550
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2102096440
> @raulcd Should we port this to 16.1.0?
I'll try to add it
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2101804093
@raulcd Should we port this to 16.1.0?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2096349580
@pitrou @jorisvandenbossche Would you mind taking a look at this?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2096347303
:warning: GitHub issue #41431 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #41550:
URL: https://github.com/apache/arrow/pull/41550#issuecomment-2099588555
I'll merge this. Thanks @mapleFU and @pitrou for the review!
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #41550:
URL: https://github.com/apache/arrow/pull/41550#discussion_r1591255111
##########
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:
This is confusing, here we set `file_decryptor_` from `file_metadata_`, but in `ParseUnencryptedFileMetadata` and `ParseMetaDataOfEncryptedFileWithPlaintextFooter` we set `file_metadata_` from `file_decryptor_`. Can we please make this consistent?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #41550:
URL: https://github.com/apache/arrow/pull/41550#discussion_r1591990664
##########
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:
I think this begs the question: do we need a `file_decryptor_` field here? We could just get it from the metadata everytime.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-41431: [C++][Parquet][Dataset] Fix repeated scan on encrypted dataset [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on code in PR #41550:
URL: https://github.com/apache/arrow/pull/41550#discussion_r1592079278
##########
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:
I have removed `file_decryptor_` from `SerializedFile` and `SerializedRowGroup`. Let me know WDYT. @pitrou
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org