parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject git commit: PARQUET-19: Fix NPE when an empty file is included in a Hive query that uses CombineHiveInputFormat
Date Tue, 29 Jul 2014 17:15:56 GMT
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.tt.b.ma.rt.in+parquet@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.tt.b.ma.rt.in+parquet@gmail.com>
Authored: Tue Jul 29 10:15:42 2014 -0700
Committer: julien <julien@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]);
     }
   }
 


Mime
View raw message