You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by ju...@apache.org on 2014/07/29 19:15:56 UTC
git commit: PARQUET-19: Fix NPE when an empty file is included in a
Hive query that uses CombineHiveInputFormat
Repository: incubator-parquet-mr
Updated Branches:
refs/heads/master 17864dfc0 -> fc2c29df7
PARQUET-19: Fix NPE when an empty file is included in a Hive query that uses CombineHiveInputFormat
Make sure the valueObj instance variable is always initialized. This change is neeeded when running a Hive query that uses the CombineHiveInputFormat and the first file in the combined split is empty. This can lead to a NullPointerException because the valueObj is null when the CombineHiveInputFormat calls the createValue method.
Author: Matthieu Martin <ma...@gmail.com>
Closes #19 from matt-martin/fix_for_empty_files_NPE_with_CombineHiveInputFormat and squashes the following commits:
6c3a7f5 [Matthieu Martin] Make sure the valueObj instance variable is always initialized. This change is neeeded when running a Hive query that uses the CombineHiveInputFormat and the first file in the combined split is empty. This can lead to a NullPointerException because the valueObj is null when the CombineHiveInputFormat calls the createValue method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/commit/fc2c29df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/tree/fc2c29df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/diff/fc2c29df
Branch: refs/heads/master
Commit: fc2c29df71c8455346a00b43dd1c4f118c335d2c
Parents: 17864df
Author: Matthieu Martin <ma...@gmail.com>
Authored: Tue Jul 29 10:15:42 2014 -0700
Committer: julien <ju...@twitter.com>
Committed: Tue Jul 29 10:15:42 2014 -0700
----------------------------------------------------------------------
.../hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/fc2c29df/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java
----------------------------------------------------------------------
diff --git a/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java b/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java
index b74bf80..9e98781 100644
--- a/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java
+++ b/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java
@@ -106,9 +106,9 @@ public class ParquetRecordReaderWrapper implements RecordReader<Void, ArrayWrit
} else {
realReader = null;
eof = true;
- if (valueObj == null) { // Should initialize the value for createValue
- valueObj = new ArrayWritable(Writable.class, new Writable[schemaSize]);
- }
+ }
+ if (valueObj == null) { // Should initialize the value for createValue
+ valueObj = new ArrayWritable(Writable.class, new Writable[schemaSize]);
}
}