You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2016/05/31 15:34:21 UTC

hive git commit: HIVE-13844: Invalid index handler in org.apache.hadoop.hive.ql.index.HiveIndex class (Svetozar Ivanov, reviewed by Jesus Camacho Rodriguez)

Repository: hive
Updated Branches:
  refs/heads/master 411ab3feb -> e459a6728


HIVE-13844: Invalid index handler in org.apache.hadoop.hive.ql.index.HiveIndex class (Svetozar Ivanov, reviewed by Jesus Camacho Rodriguez)


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

Branch: refs/heads/master
Commit: e459a67283900393a79e4f69853103cc4fd8a726
Parents: 411ab3f
Author: Svetozar Ivanov <sv...@mo-data.com>
Authored: Tue May 31 16:31:19 2016 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Tue May 31 16:33:09 2016 +0100

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/index/HiveIndex.java  |  9 +++---
 .../hadoop/hive/ql/index/TestIndexType.java     | 34 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/e459a672/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java b/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
index 36bc9cd..a1408e9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java
@@ -17,6 +17,8 @@
  */
 package org.apache.hadoop.hive.ql.index;
 
+import org.apache.hadoop.hive.ql.index.bitmap.BitmapIndexHandler;
+import org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,10 +32,9 @@ public class HiveIndex {
   public static String INDEX_TABLE_CREATETIME = "hive.index.basetbl.dfs.lastModifiedTime";
 
   public static enum IndexType {
-    AGGREGATE_TABLE("aggregate", "org.apache.hadoop.hive.ql.AggregateIndexHandler"),
-    COMPACT_SUMMARY_TABLE("compact", "org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler"),
-    BITMAP_TABLE("bitmap",
-"org.apache.hadoop.hive.ql.index.bitmap.BitmapIndexHandler");
+    AGGREGATE_TABLE("aggregate",  AggregateIndexHandler.class.getName()),
+    COMPACT_SUMMARY_TABLE("compact", CompactIndexHandler.class.getName()),
+    BITMAP_TABLE("bitmap", BitmapIndexHandler.class.getName());
 
     private IndexType(String indexType, String className) {
       indexTypeName = indexType;

http://git-wip-us.apache.org/repos/asf/hive/blob/e459a672/ql/src/test/org/apache/hadoop/hive/ql/index/TestIndexType.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/index/TestIndexType.java b/ql/src/test/org/apache/hadoop/hive/ql/index/TestIndexType.java
new file mode 100644
index 0000000..bc1f8d4
--- /dev/null
+++ b/ql/src/test/org/apache/hadoop/hive/ql/index/TestIndexType.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.index;
+
+import junit.framework.TestCase;
+import org.apache.hadoop.hive.ql.index.bitmap.BitmapIndexHandler;
+import org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler;
+import org.junit.Test;
+
+public class TestIndexType extends TestCase {
+
+    @Test
+    public void testIndexTypeHandlers(){
+        assertEquals(HiveIndex.IndexType.AGGREGATE_TABLE.getHandlerClsName(), AggregateIndexHandler.class.getName());
+        assertEquals(HiveIndex.IndexType.BITMAP_TABLE.getHandlerClsName(), BitmapIndexHandler.class.getName());
+        assertEquals(HiveIndex.IndexType.COMPACT_SUMMARY_TABLE.getHandlerClsName(), CompactIndexHandler.class.getName());
+    }
+
+}