[ https://issues.apache.org/jira/browse/HIVE-24912?focusedWorklogId=575272&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-575272 ]
ASF GitHub Bot logged work on HIVE-24912: ----------------------------------------- Author: ASF GitHub Bot Created on: 01/Apr/21 01:54 Start Date: 01/Apr/21 01:54 Worklog Time Spent: 10m Work Description: hmangla98 commented on a change in pull request #2092: URL: https://github.com/apache/hive/pull/2092#discussion_r605326404 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java ########## @@ -163,6 +163,17 @@ public IncrementalLoadTasksBuilder(String dbName, String loadPath, taskChainTail.addDependentTask(updateIncPendTask); taskChainTail = updateIncPendTask; + Database dbToLoadIn = hive.getDatabase(dbName); + if (dbToLoadIn != null && !ReplUtils.isTargetOfReplication(dbToLoadIn)) { Review comment: We have one test in TestReplicationScenarios.testTaskCreationOptimization in which we may get dbToLoadIn to be null. Rest in all cases, it would be not null. ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java ########## @@ -163,6 +163,17 @@ public IncrementalLoadTasksBuilder(String dbName, String loadPath, taskChainTail.addDependentTask(updateIncPendTask); taskChainTail = updateIncPendTask; + Database dbToLoadIn = hive.getDatabase(dbName); + if (dbToLoadIn != null && !ReplUtils.isTargetOfReplication(dbToLoadIn)) { + Map<String, String> props = new HashMap<>(); + props.put(ReplUtils.TARGET_OF_REPLICATION, "true"); Review comment: It just appends this prop to existing db properties. ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcrossInstances.java ########## @@ -1114,13 +1115,18 @@ public void testIfCkptAndSourceOfReplPropsIgnoredByReplDump() throws Throwable { .dump(primaryDbName, Collections.emptyList()); // Incremental Repl A -> B with alters on db/table/partition - WarehouseInstance.Tuple tupleReplicaInc = replica.load(replicatedDbName, primaryDbName) - .run("repl status " + replicatedDbName) + replica.load(replicatedDbName, primaryDbName); Review comment: Done ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java ########## @@ -4287,6 +4288,37 @@ public void testMoveOptimizationIncremental() throws IOException { verifyRun("SELECT count(*) from " + replDbName + ".unptned_late ", "3", driverMirror); } + @Test + public void testReplTargetSetInIncremental() throws Exception { + String name = testName.getMethodName(); + String dbName = createDB(name, driver); Review comment: Done ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java ########## @@ -4287,6 +4288,37 @@ public void testMoveOptimizationIncremental() throws IOException { verifyRun("SELECT count(*) from " + replDbName + ".unptned_late ", "3", driverMirror); } + @Test + public void testReplTargetSetInIncremental() throws Exception { + String name = testName.getMethodName(); + String dbName = createDB(name, driver); + String replDbName = dbName + "_dupe"; + + run("CREATE TABLE " + dbName + ".unptned(a string) STORED AS TEXTFILE", driver); + Tuple bootstrapDump = bootstrapLoadAndVerify(dbName, replDbName); + Review comment: Done ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java ########## @@ -4287,6 +4288,37 @@ public void testMoveOptimizationIncremental() throws IOException { verifyRun("SELECT count(*) from " + replDbName + ".unptned_late ", "3", driverMirror); } + @Test + public void testReplTargetSetInIncremental() throws Exception { + String name = testName.getMethodName(); + String dbName = createDB(name, driver); + String replDbName = dbName + "_dupe"; + + run("CREATE TABLE " + dbName + ".unptned(a string) STORED AS TEXTFILE", driver); + Tuple bootstrapDump = bootstrapLoadAndVerify(dbName, replDbName); + + // Remove TARGET_OF_REPLICATION property. + run("ALTER DATABASE " + replDbName + " Set DBPROPERTIES ( '" + TARGET_OF_REPLICATION + "' = '')", driverMirror); + Review comment: Done -- 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 Issue Time Tracking ------------------- Worklog Id: (was: 575272) Time Spent: 0.5h (was: 20m) > Support to add repl.target.for property during incremental run > -------------------------------------------------------------- > > Key: HIVE-24912 > URL: https://issues.apache.org/jira/browse/HIVE-24912 > Project: Hive > Issue Type: Bug > Reporter: Haymant Mangla > Assignee: Haymant Mangla > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)