You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ek...@apache.org on 2017/12/12 00:09:19 UTC

hive git commit: HIVE-18133 - Parametrize TestTxnNoBuckets wrt Vectorization (Eugene Koifman, reviewed by Prasanth Jayachandran)

Repository: hive
Updated Branches:
  refs/heads/master 3bbc24d25 -> b38544f69


HIVE-18133 - Parametrize TestTxnNoBuckets wrt Vectorization (Eugene Koifman, reviewed by Prasanth Jayachandran)


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

Branch: refs/heads/master
Commit: b38544f6933efd51f753567585ce3da170d63947
Parents: 3bbc24d
Author: Eugene Koifman <ek...@hortonworks.com>
Authored: Mon Dec 11 16:04:11 2017 -0800
Committer: Eugene Koifman <ek...@hortonworks.com>
Committed: Mon Dec 11 16:08:46 2017 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/TestTxnNoBuckets.java | 21 ++++++--------
 .../hive/ql/TestTxnNoBucketsVectorized.java     | 29 ++++++++++++++++++++
 2 files changed, 38 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b38544f6/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBuckets.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBuckets.java b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBuckets.java
index f5f8cc8..780b97c 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBuckets.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBuckets.java
@@ -55,13 +55,10 @@ public class TestTxnNoBuckets extends TxnCommandsBaseForTests {
   String getTestDataDir() {
     return TEST_DATA_DIR;
   }
-  @Override
-  @Before
-  public void setUp() throws Exception {
-    setUpInternal();
-    hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED, true);
-  }
 
+  private boolean shouldVectorize() {
+    return hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED);
+  }
   /**
    * Tests that Acid can work with un-bucketed tables.
    */
@@ -351,9 +348,9 @@ ekoifman:apache-hive-3.0.0-SNAPSHOT-bin ekoifman$ tree /Users/ekoifman/dev/hiver
     Assert.assertEquals(2, BucketCodec.determineVersion(537001984).decodeWriterId(537001984));
     Assert.assertEquals(1, BucketCodec.determineVersion(536936448).decodeWriterId(536936448));
 
-    assertVectorized(true, "update T set b = 88 where b = 80");
+    assertVectorized(shouldVectorize(), "update T set b = 88 where b = 80");
     runStatementOnDriver("update T set b = 88 where b = 80");
-    assertVectorized(true, "delete from T where b = 8");
+    assertVectorized(shouldVectorize(), "delete from T where b = 8");
     runStatementOnDriver("delete from T where b = 8");
     String expected3[][] = {
       {"{\"transactionid\":0,\"bucketid\":537001984,\"rowid\":0}\t1\t2",  "warehouse/t/000002_0"},
@@ -550,7 +547,7 @@ ekoifman:apache-hive-3.0.0-SNAPSHOT-bin ekoifman$ tree /Users/ekoifman/dev/hiver
     checkExpected(rs, expected, "After conversion");
     Assert.assertEquals(Integer.toString(6), rs.get(0));
     Assert.assertEquals(Integer.toString(9), rs.get(1));
-    assertVectorized(true, query);
+    assertVectorized(shouldVectorize(), query);
 
     //why isn't PPD working.... - it is working but storage layer doesn't do row level filtering; only row group level
     //this uses VectorizedOrcAcidRowBatchReader
@@ -561,7 +558,7 @@ ekoifman:apache-hive-3.0.0-SNAPSHOT-bin ekoifman$ tree /Users/ekoifman/dev/hiver
       {"{\"transactionid\":0,\"bucketid\":536870912,\"rowid\":4}", "9"}
     };
     checkExpected(rs, expected1, "After conversion with VC1");
-    assertVectorized(true, query);
+    assertVectorized(shouldVectorize(), query);
 
     //this uses VectorizedOrcAcidRowBatchReader
     query = "select ROW__ID, a from T where b > 0 order by a";
@@ -574,7 +571,7 @@ ekoifman:apache-hive-3.0.0-SNAPSHOT-bin ekoifman$ tree /Users/ekoifman/dev/hiver
       {"{\"transactionid\":0,\"bucketid\":536870912,\"rowid\":4}", "9"}
     };
     checkExpected(rs, expected2, "After conversion with VC2");
-    assertVectorized(true, query);
+    assertVectorized(shouldVectorize(), query);
 
     //doesn't vectorize (uses neither of the Vectorzied Acid readers)
     query = "select ROW__ID, a, INPUT__FILE__NAME from T where b > 6 order by a";
@@ -601,7 +598,7 @@ ekoifman:apache-hive-3.0.0-SNAPSHOT-bin ekoifman$ tree /Users/ekoifman/dev/hiver
       {"{\"transactionid\":0,\"bucketid\":536870912,\"rowid\":4}","10"}
     };
     checkExpected(rs, expected4, "After conversion with VC4");
-    assertVectorized(true, query);
+    assertVectorized(shouldVectorize(), query);
 
     runStatementOnDriver("alter table T compact 'major'");
     TestTxnCommands2.runWorker(hiveConf);

http://git-wip-us.apache.org/repos/asf/hive/blob/b38544f6/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBucketsVectorized.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBucketsVectorized.java b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBucketsVectorized.java
new file mode 100644
index 0000000..8aa967f
--- /dev/null
+++ b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnNoBucketsVectorized.java
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.junit.Before;
+
+public class TestTxnNoBucketsVectorized extends TestTxnNoBuckets {
+  @Before
+  public void setUp() throws Exception {
+    setUpInternal();
+    hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED, true);
+  }
+}