ggershinsky commented on code in PR #14528:
URL: https://github.com/apache/iceberg/pull/14528#discussion_r2507721555
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetEncryption.java:
##########
@@ -125,4 +138,57 @@ public void testReadEncryptedFile() throws IOException {
}
}
}
+
+ @Test
+ public void testReadAndWriteHadoopFile() throws IOException {
+ List<GenericRecord> records = Lists.newArrayListWithCapacity(RECORD_COUNT);
+ for (int i = 1; i <= RECORD_COUNT; i++) {
+ GenericRecord record = GenericRecord.create(SCHEMA.asStruct());
+ record.set(0, i);
+ records.add(record);
+ }
+
+ org.apache.hadoop.fs.Path path = new
org.apache.hadoop.fs.Path(createTempFile(temp).toURI());
+
+ EncryptedOutputFile encryptedOutputFile =
+ EncryptionTestHelpers.createEncryptionManager()
+ .encrypt(HadoopOutputFile.fromPath(path, new Configuration()));
+ NativeEncryptionKeyMetadata keyMetadata =
+ ((NativeEncryptionOutputFile) encryptedOutputFile).keyMetadata();
+ FileAppender<GenericRecord> writer =
+ Parquet.write(encryptedOutputFile.encryptingOutputFile())
Review Comment:
I wonder why this does not result in double encryption (sending PME to
AesGcmOutputStream). Seemingly,
`encryptedOutputFile.encryptingOutputFile().create()` calls `new
AesGcmOutputFile(..).create()`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]