ggershinsky commented on a change in pull request #776:
URL: https://github.com/apache/parquet-mr/pull/776#discussion_r428465094



##########
File path: 
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
##########
@@ -705,22 +797,39 @@ public ParquetFileReader(Configuration conf, Path file, 
ParquetMetadata footer)
       paths.put(ColumnPath.get(col.getPath()), col);
     }
     this.crc = options.usePageChecksumVerification() ? new CRC32() : null;
+    this.fileDecryptor = fileMetaData.getFileDecryptor();
   }
 
   public ParquetFileReader(InputFile file, ParquetReadOptions options) throws 
IOException {
+    this(file, options, null);
+  }
+
+  public ParquetFileReader(InputFile file, ParquetReadOptions options, 
+      FileDecryptionProperties fileDecryptionProperties) throws IOException {
     this.converter = new ParquetMetadataConverter(options);
     this.file = file;
     this.f = file.newStream();
     this.options = options;
+    if ((null == fileDecryptionProperties) && (file instanceof 
HadoopInputFile)) {
+      HadoopInputFile hadoopFile = (HadoopInputFile) file;
+      fileDecryptionProperties = getDecryptionProperties(hadoopFile.getPath(), 
hadoopFile.getConfiguration());

Review comment:
       We need the file `Path` in order to create the file decryption 
properties. `ParquetReadOptions` and `HadoopReadOptions` don't keep/handle the 
file paths.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to