Repository: hive
Updated Branches:
  refs/heads/master de3d86cdd -> 44265d94d


HIVE-14083: ALTER INDEX in Tez causes NullPointerException (Jesus Camacho 
Rodriguez, reviewed by Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/44265d94
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/44265d94
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/44265d94

Branch: refs/heads/master
Commit: 44265d94d71df7a2bfff130bd69fddb709994107
Parents: de3d86c
Author: Jesus Camacho Rodriguez <jcama...@apache.org>
Authored: Thu Jun 23 12:58:52 2016 -0700
Committer: Jesus Camacho Rodriguez <jcama...@apache.org>
Committed: Wed Jun 29 12:21:45 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/ql/exec/DDLTask.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/44265d94/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
index 7099b2a..bb43950 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
@@ -233,7 +233,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.stringtemplate.v4.ST;
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
 /**
@@ -887,12 +886,21 @@ public class DDLTask extends Task<DDLWork> implements 
Serializable {
   }
 
   private int dropIndex(Hive db, DropIndexDesc dropIdx) throws HiveException {
+
+    if (HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
+      throw new UnsupportedOperationException("Indexes unsupported for Tez 
execution engine");
+    }
+
     db.dropIndex(dropIdx.getTableName(), dropIdx.getIndexName(), 
dropIdx.isThrowException(), true);
     return 0;
   }
 
   private int createIndex(Hive db, CreateIndexDesc crtIndex) throws 
HiveException {
 
+    if (HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
+      throw new UnsupportedOperationException("Indexes unsupported for Tez 
execution engine");
+    }
+
     if( crtIndex.getSerde() != null) {
       validateSerDe(crtIndex.getSerde());
     }
@@ -920,6 +928,11 @@ public class DDLTask extends Task<DDLWork> implements 
Serializable {
   }
 
   private int alterIndex(Hive db, AlterIndexDesc alterIndex) throws 
HiveException {
+
+    if (HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {
+      throw new UnsupportedOperationException("Indexes unsupported for Tez 
execution engine");
+    }
+
     String baseTableName = alterIndex.getBaseTableName();
     String indexName = alterIndex.getIndexName();
     Index idx = db.getIndex(baseTableName, indexName);

Reply via email to