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 2023/09/27 15:44:00 UTC

[GitHub] [arrow] wgtmac commented on a diff in pull request #36574: GH-34950: [C++][Parquet] Support encryption for page index

wgtmac commented on code in PR #36574:
URL: https://github.com/apache/arrow/pull/36574#discussion_r1338814429


##########
cpp/src/parquet/encryption/internal_file_decryptor.cc:
##########
@@ -215,4 +217,53 @@ std::shared_ptr<Decryptor> InternalFileDecryptor::GetColumnDecryptor(
   return column_data_map_[column_path];
 }
 
+namespace {
+
+std::shared_ptr<Decryptor> GetColumnDecryptor(
+    const ColumnCryptoMetaData* crypto_metadata, InternalFileDecryptor* file_decryptor,
+    const std::function<std::shared_ptr<Decryptor>(
+        InternalFileDecryptor* file_decryptor, const std::string& column_path,
+        const std::string& column_key_metadata, const std::string& aad)>& func) {
+  if (crypto_metadata == nullptr) {
+    return nullptr;
+  }
+
+  if (file_decryptor == nullptr) {
+    throw ParquetException("RowGroup is noted as encrypted but no file decryptor");
+  }
+
+  if (crypto_metadata->encrypted_with_footer_key()) {
+    return file_decryptor->GetFooterDecryptorForColumnMeta();

Review Comment:
   Good catch! Sorry for the mistake made by the copy-and-paste.



-- 
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