aasha commented on a change in pull request #1422: URL: https://github.com/apache/hive/pull/1422#discussion_r476198220
########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java ########## @@ -542,6 +549,24 @@ private Long incrementalDump(Path dumpRoot, DumpMetaData dmd, Path cmRoot, Hive if (ev.getEventId() <= resumeFrom) { continue; } + + //disable materialized-view replication if configured + String tblName = null; + tblName = ev.getTableName(); + if(tblName != null) { + try { + Table table = null; + HiveWrapper.Tuple<Table> TableTuple = new HiveWrapper(hiveDb, dbName).table(tblName, conf); Review comment: rename the variable. should start with small letter ########## File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ########## @@ -540,6 +540,8 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal REPL_DUMP_METADATA_ONLY("hive.repl.dump.metadata.only", false, "Indicates whether replication dump only metadata information or data + metadata. \n" + "This config makes hive.repl.include.external.tables config ineffective."), + REPL_MATERIALIZED_VIEWS_ENABLED("hive.repl.materialized.views.enabled", false, Review comment: rename to REPL_INCLUDE_MATERIALIZED_VIEWS to match the other config naming ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java ########## @@ -136,7 +136,7 @@ protected static final Logger LOG = LoggerFactory.getLogger(TestReplicationScenarios.class); private ArrayList<String> lastResults; - private final boolean VERIFY_SETUP_STEPS = false; + private boolean VERIFY_SETUP_STEPS = false; Review comment: can be removed. the value is overwritten inside the tests so not a constant ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java ########## @@ -542,6 +549,24 @@ private Long incrementalDump(Path dumpRoot, DumpMetaData dmd, Path cmRoot, Hive if (ev.getEventId() <= resumeFrom) { continue; } + + //disable materialized-view replication if configured + String tblName = null; + tblName = ev.getTableName(); + if(tblName != null) { + try { + Table table = null; + HiveWrapper.Tuple<Table> TableTuple = new HiveWrapper(hiveDb, dbName).table(tblName, conf); + table = TableTuple != null ? TableTuple.object : null; Review comment: can be initialised in the same statement ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java ########## @@ -542,6 +549,24 @@ private Long incrementalDump(Path dumpRoot, DumpMetaData dmd, Path cmRoot, Hive if (ev.getEventId() <= resumeFrom) { continue; } + + //disable materialized-view replication if configured + String tblName = null; + tblName = ev.getTableName(); Review comment: can be initialised in the same statement ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java ########## @@ -542,6 +549,24 @@ private Long incrementalDump(Path dumpRoot, DumpMetaData dmd, Path cmRoot, Hive if (ev.getEventId() <= resumeFrom) { continue; } + + //disable materialized-view replication if configured + String tblName = null; + tblName = ev.getTableName(); + if(tblName != null) { + try { + Table table = null; + HiveWrapper.Tuple<Table> TableTuple = new HiveWrapper(hiveDb, dbName).table(tblName, conf); + table = TableTuple != null ? TableTuple.object : null; + if (TableTuple != null && TableType.MATERIALIZED_VIEW.equals(TableTuple.object.getTableType()) && !isMaterializedViewsReplEnabled()) { Review comment: isMaterializedViewsReplEnabled check can be done at the top. no processing is needed if its enabled ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java ########## @@ -2518,11 +2518,16 @@ public void testRenamePartitionedTableAcrossDatabases() throws IOException { @Test public void testViewsReplication() throws IOException { + boolean verify_setup_tmp = VERIFY_SETUP_STEPS; Review comment: you can add a new test just for MV. Create MV with same DB and diff DB Test after bootstrap, replica shouldn't have MV. Create MV with same DB and diff DB Test after incremental, replica shouldn't have MV. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org