[
https://issues.apache.org/jira/browse/PARQUET-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17522364#comment-17522364
]
ASF GitHub Bot commented on PARQUET-2136:
-----------------------------------------
ggershinsky commented on code in PR #954:
URL: https://github.com/apache/parquet-mr/pull/954#discussion_r850534162
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java:
##########
@@ -336,20 +354,30 @@ public ParquetFileWriter(OutputFile file, MessageType
schema, Mode mode,
this.metadataConverter = new
ParquetMetadataConverter(statisticsTruncateLength);
- if (null == encryptionProperties) {
+ if (null == encryptionProperties && null == encryptor) {
this.fileEncryptor = null;
- } else {
- // Verify that every encrypted column is in file schema
- Map<ColumnPath, ColumnEncryptionProperties> columnEncryptionProperties =
encryptionProperties.getEncryptedColumns();
- if (null != columnEncryptionProperties) { // if null, every column in
file schema will be encrypted with footer key
- for (Map.Entry<ColumnPath, ColumnEncryptionProperties> entry :
columnEncryptionProperties.entrySet()) {
- String[] path = entry.getKey().toArray();
- if(!schema.containsPath(path)) {
- throw new ParquetCryptoRuntimeException("Encrypted column " +
Arrays.toString(path) + " not in file schema");
- }
+ return;
+ }
+
+ if (null == encryptionProperties) {
+ encryptionProperties = encryptor.getEncryptionProperties();
Review Comment:
per the lines 357, 359 and 362, we can be in 363 only if
encryptionProperties is null and encryptor is not null
> File writer construction with encryptor
> ---------------------------------------
>
> Key: PARQUET-2136
> URL: https://issues.apache.org/jira/browse/PARQUET-2136
> Project: Parquet
> Issue Type: Improvement
> Components: parquet-mr
> Affects Versions: 1.12.2
> Reporter: Gidon Gershinsky
> Assignee: Gidon Gershinsky
> Priority: Major
>
> Currently, a file writer object can be constructed with encryption
> properties. We need an additional constructor, that can accept an encryptor
> instead, in order to support lazy materialization of parquet file writers.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)