hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gunt...@apache.org
Subject svn commit: r1581008 - /hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java
Date Mon, 24 Mar 2014 19:17:31 GMT
Author: gunther
Date: Mon Mar 24 19:17:30 2014
New Revision: 1581008

URL: http://svn.apache.org/r1581008
Log:
HIVE-6716: ORC struct throws NPE for tables with inner structs having null values (Prasanth
J via Gunther Hagleitner)

Modified:
    hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java

Modified: hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java?rev=1581008&r1=1581007&r2=1581008&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java
(original)
+++ hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java
Mon Mar 24 19:17:30 2014
@@ -207,11 +207,17 @@ final public class OrcStruct implements 
 
     @Override
     public Object getStructFieldData(Object object, StructField field) {
+      if (object == null) {
+        return null;
+      }
       return ((OrcStruct) object).fields[((Field) field).offset];
     }
 
     @Override
     public List<Object> getStructFieldsDataAsList(Object object) {
+      if (object == null) {
+        return null;
+      }
       OrcStruct struct = (OrcStruct) object;
       List<Object> result = new ArrayList<Object>(struct.fields.length);
       for (Object child: struct.fields) {



Mime
View raw message