pvary commented on code in PR #14528:
URL: https://github.com/apache/iceberg/pull/14528#discussion_r2508142211
##########
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 don't fully understand your comment, but if you take a look at the
`Parquet.write` implementation, there are different methods for
Encrypted/non-Encrypted files, but all of them ends in using the
`EncryptedOutputFile.encryptingOutputFile()`.
With the new implementation the
`StandardEncryptedOutputFile.encryptingOutputFile()` returns the same as
`StandardEncryptedOutputFile.encryptingOutputFile().encryptingOutputFile()`.
Parquet uses the OutputStreams, which are also the same, no matter how many
times you call the `encryptingOutputFile()` before getting the OutputStream`
--
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]