pitrou commented on code in PR #48336:
URL: https://github.com/apache/arrow/pull/48336#discussion_r2589729909
##########
cpp/src/parquet/arrow/generate_fuzz_corpus.cc:
##########
@@ -146,8 +145,77 @@ std::vector<WriteConfig> GetWriteConfigurations() {
return configs;
}
-Result<std::vector<Column>> ExampleColumns(int32_t length,
- double null_probability = 0.2) {
+std::vector<WriteConfig> GetEncryptedWriteConfigurations(const
::arrow::Schema& schema) {
+ using ::parquet::ColumnEncryptionProperties;
+ using ::parquet::ColumnPathToEncryptionPropertiesMap;
+ using ::parquet::FileEncryptionProperties;
+ using ::parquet::fuzzing::internal::MakeEncryptionKey;
+
+ auto file_encryption_builder = [&]() {
+ auto footer_key = MakeEncryptionKey();
+ ::parquet::FileEncryptionProperties::Builder builder(footer_key.key);
+ builder.footer_key_metadata(footer_key.key_metadata);
+ return builder;
+ };
+
+ std::vector<std::shared_ptr<FileEncryptionProperties>> file_encryptions;
+
+ // Uniform encryption
+ file_encryptions.push_back(file_encryption_builder().build());
+ // Uniform encryption with plaintext footer
+
file_encryptions.push_back(file_encryption_builder().set_plaintext_footer()->build());
+ // Columns encrypted with individual keys
+ {
+ ColumnPathToEncryptionPropertiesMap column_map;
+ for (const auto& field : schema.fields()) {
+ // Skip nested columns (they will not be encrypted) until GH-41246 makes
+ // their configuration easier.
Review Comment:
FTR @EnricoMi :-)
--
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]