[ 
https://issues.apache.org/jira/browse/PARQUET-2185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17607027#comment-17607027
 ] 

ASF GitHub Bot commented on PARQUET-2185:
-----------------------------------------

ggershinsky merged PR #994:
URL: https://github.com/apache/parquet-mr/pull/994




> ParquetReader constructed using builder fails to read encrypted files
> ---------------------------------------------------------------------
>
>                 Key: PARQUET-2185
>                 URL: https://issues.apache.org/jira/browse/PARQUET-2185
>             Project: Parquet
>          Issue Type: Bug
>            Reporter: Atul Mohan
>            Priority: Minor
>
> ParquetReader objects can be constructed using the builder as follows:
>  {code:java}
> ParquetReader<Group> builderReader = ParquetReader.builder(new 
> GroupReadSupport(),new Path("path/to/c000.snappy.parquet"))
> .withConf(conf)
> .build();
> {code}
> This parquetReader object cannot be used to read encrypted files as 
> {noformat}
> builderReader.read(){noformat}
>  fails with the following exception:
>  
> {code:java}
> java.lang.NullPointerException at 
> org.apache.parquet.crypto.keytools.FileKeyUnwrapper.getKey(FileKeyUnwrapper.java:87)
>   {code}
> It seems like the reason is that the _withConf_ method within the 
> ParquetReader builder [clears the optionsBuilder set 
> earlier|https://github.com/apache/parquet-mr/blob/master/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetReader.java#L231].
> Here is a sample test showcasing the issue: 
> [https://gist.github.com/a2l007/3d813cc5e44c45100dda169dc6245ae4]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to