You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "Atul Mohan (Jira)" <ji...@apache.org> on 2022/09/07 16:03:00 UTC

[jira] [Updated] (PARQUET-2185) ParquetReader constructed using builder fails to read encrypted files

     [ https://issues.apache.org/jira/browse/PARQUET-2185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Atul Mohan updated PARQUET-2185:
--------------------------------
    Description: 
ParquetReader objects can be constructed using the builder as follows:

 
ParquetReader<Group> builderReader = ParquetReader.builder(new GroupReadSupport(),new Path("path/to/c000.snappy.parquet"))
.withConf(conf)
.build();

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]

  was:
ParquetReader objects can be constructed using the builder as follows:

 
ParquetReader<Group> builderReader = ParquetReader.builder(new GroupReadSupport(),new Path("path/to/c000.snappy.parquet"))
.withConf(conf)
.build();
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]


> 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:
>  
> ParquetReader<Group> builderReader = ParquetReader.builder(new GroupReadSupport(),new Path("path/to/c000.snappy.parquet"))
> .withConf(conf)
> .build();
> 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)