hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1389072 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
Date Sun, 23 Sep 2012 15:03:59 GMT
Author: namit
Date: Sun Sep 23 15:03:58 2012
New Revision: 1389072

URL: http://svn.apache.org/viewvc?rev=1389072&view=rev
Log:
HIVE-3497 Avoid NPE in skewed information read
(Gang Tim Liu via namit)


Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java?rev=1389072&r1=1389071&r2=1389072&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java Sun Sep 23 15:03:58
2012
@@ -528,7 +528,8 @@ public class Table implements Serializab
   }
 
   public Map<List<String>,String> getSkewedColValueLocationMaps() {
-    return tTable.getSd().getSkewedInfo().getSkewedColValueLocationMaps();
+    return (tTable.getSd().getSkewedInfo() != null) ? tTable.getSd().getSkewedInfo()
+        .getSkewedColValueLocationMaps() : new HashMap<List<String>, String>();
   }
 
   public void setSkewedColValues(List<List<String>> skewedValues) throws HiveException
{
@@ -536,7 +537,8 @@ public class Table implements Serializab
   }
 
   public List<List<String>> getSkewedColValues(){
-    return tTable.getSd().getSkewedInfo().getSkewedColValues();
+    return (tTable.getSd().getSkewedInfo() != null) ? tTable.getSd().getSkewedInfo()
+        .getSkewedColValues() : new ArrayList<List<String>>();
   }
 
   public void setSkewedColNames(List<String> skewedColNames) throws HiveException {
@@ -544,7 +546,8 @@ public class Table implements Serializab
   }
 
   public List<String> getSkewedColNames() {
-    return tTable.getSd().getSkewedInfo().getSkewedColNames();
+    return (tTable.getSd().getSkewedInfo() != null) ? tTable.getSd().getSkewedInfo()
+        .getSkewedColNames() : new ArrayList<String>();
   }
 
 



Mime
View raw message