You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by GitBox <gi...@apache.org> on 2021/03/16 15:29:44 UTC
[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #881: PARQUET-1999: NPE might occur if OutputFile is implemented by the client
gszadovszky commented on a change in pull request #881:
URL: https://github.com/apache/parquet-mr/pull/881#discussion_r595282860
##########
File path: parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java
##########
@@ -281,8 +281,9 @@ public ParquetWriter(Path file, Configuration conf, WriteSupport<T> writeSupport
// encryptionProperties could be built from the implementation of EncryptionPropertiesFactory when it is attached.
if (encryptionProperties == null) {
+ String path = file == null ? null : file.getPath();
encryptionProperties = ParquetOutputFormat.createEncryptionProperties(conf,
- file == null ? null : new Path(file.getPath()), writeContext);
+ path == null ? null : new Path(path), writeContext);
Review comment:
We are not checking the same twice. Once, we are checking the argument `file` if it is `null` then we are checking if the value returned by `file.getPath()` is `null`. (The latter check was missing and that caused the issue.)
----------------------------------------------------------------
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:
users@infra.apache.org