You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by da...@apache.org on 2018/01/26 23:45:21 UTC

hive git commit: HIVE-18530: Replication should skip MM table (for now) (Daniel Dai, reviewed by Thejas Nair)

Repository: hive
Updated Branches:
  refs/heads/master 6b349b5f8 -> ad1552745


HIVE-18530: Replication should skip MM table (for now) (Daniel Dai, reviewed by Thejas Nair)


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

Branch: refs/heads/master
Commit: ad1552745441e7acfa0ed02f490f6b21f1cbe3ff
Parents: 6b349b5
Author: Daniel Dai <da...@hortonworks.com>
Authored: Fri Jan 26 15:44:38 2018 -0800
Committer: Daniel Dai <da...@hortonworks.com>
Committed: Fri Jan 26 15:44:44 2018 -0800

----------------------------------------------------------------------
 .../hadoop/hive/ql/parse/TestReplicationScenarios.java    | 10 ++++++++++
 .../org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java  |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ad155274/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
----------------------------------------------------------------------
diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
index ed998d2..0062052 100644
--- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
+++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
@@ -3226,7 +3226,11 @@ public class TestReplicationScenarios {
     // Create table
     run("CREATE TABLE " + dbName + ".acid_table (key int, value int) PARTITIONED BY (load_date date) " +
         "CLUSTERED BY(key) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional'='true')", driver);
+    run("CREATE TABLE " + dbName + ".mm_table (key int, value int) PARTITIONED BY (load_date date) " +
+        "CLUSTERED BY(key) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional'='true'," +
+        " 'transactional_properties'='insert_only')", driver);
     verifyIfTableExist(dbName, "acid_table", metaStoreClient);
+    verifyIfTableExist(dbName, "mm_table", metaStoreClient);
 
     // Bootstrap test
     advanceDumpDir();
@@ -3236,6 +3240,7 @@ public class TestReplicationScenarios {
     LOG.info("Bootstrap-Dump: Dumped to {} with id {}", replDumpLocn, replDumpId);
     run("REPL LOAD " + dbName + "_dupe FROM '" + replDumpLocn + "'", driverMirror);
     verifyIfTableNotExist(dbName + "_dupe", "acid_table", metaStoreClientMirror);
+    verifyIfTableNotExist(dbName + "_dupe", "mm_table", metaStoreClientMirror);
 
     // Test alter table
     run("ALTER TABLE " + dbName + ".acid_table RENAME TO " + dbName + ".acid_table_rename", driver);
@@ -3253,7 +3258,11 @@ public class TestReplicationScenarios {
     // Create another table for incremental repl verification
     run("CREATE TABLE " + dbName + ".acid_table_incremental (key int, value int) PARTITIONED BY (load_date date) " +
         "CLUSTERED BY(key) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional'='true')", driver);
+    run("CREATE TABLE " + dbName + ".mm_table_incremental (key int, value int) PARTITIONED BY (load_date date) " +
+        "CLUSTERED BY(key) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional'='true'," +
+        " 'transactional_properties'='insert_only')", driver);
     verifyIfTableExist(dbName, "acid_table_incremental", metaStoreClient);
+    verifyIfTableExist(dbName, "mm_table_incremental", metaStoreClient);
 
     // Perform REPL-DUMP/LOAD
     advanceDumpDir();
@@ -3265,6 +3274,7 @@ public class TestReplicationScenarios {
     printOutput(driverMirror);
     run("REPL LOAD " + dbName + "_dupe FROM '"+incrementalDumpLocn+"'", driverMirror);
     verifyIfTableNotExist(dbName + "_dupe", "acid_table_incremental", metaStoreClientMirror);
+    verifyIfTableNotExist(dbName + "_dupe", "mm_table_incremental", metaStoreClientMirror);
 
     // Test adding a constraint
     run("ALTER TABLE " + dbName + ".acid_table_incremental ADD CONSTRAINT key_pk PRIMARY KEY (key) DISABLE NOVALIDATE", driver);

http://git-wip-us.apache.org/repos/asf/hive/blob/ad155274/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java
index f880913..d2bdde9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java
@@ -176,7 +176,7 @@ public class Utils {
     }
 
     if (replicationSpec.isInReplicationScope()) {
-      boolean isAcidTable = AcidUtils.isAcidTable(tableHandle);
+      boolean isAcidTable = AcidUtils.isTransactionalTable(tableHandle);
       if (isAcidTable) {
         return hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_INCLUDE_ACID_TABLES);
       }