hmangla98 commented on a change in pull request #2092:
URL: https://github.com/apache/hive/pull/2092#discussion_r606925266



##########
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -4287,6 +4288,42 @@ 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);
+    run("ALTER DATABASE " + dbName + " Set DBPROPERTIES('custom_property' = 
'custom_value')", driver);
+    String replDbName = dbName + "_dupe";
+
+    run("CREATE TABLE " + dbName + ".unptned(a string) STORED AS TEXTFILE", 
driver);
+    Tuple bootstrapDump = bootstrapLoadAndVerify(dbName, replDbName);
+    run("DESCRIBE DATABASE EXTENDED " + replDbName, driverMirror);
+    List<String> result = getOutput(driverMirror);
+    assertTrue(result.get(0), result.get(0).contains("repl.target.for=true"));
+    assertTrue(result.get(0), 
result.get(0).contains("custom_property=custom_value"));
+
+    // Remove TARGET_OF_REPLICATION property.
+    run("ALTER DATABASE " + replDbName + " Set DBPROPERTIES('" + 
TARGET_OF_REPLICATION + "' = '')", driverMirror);
+
+    run("DESCRIBE DATABASE EXTENDED " + replDbName, driverMirror);
+    result = getOutput(driverMirror);
+    assertTrue(result.get(0), result.get(0).contains("repl.target.for="));
+
+    String[] unptn_data = new String[]{ "eleven" , "twelve" };
+    String unptn_locn = new Path(TEST_PATH, name + "_unptn").toUri().getPath();
+    createTestDataFile(unptn_locn, unptn_data);
+    run("LOAD DATA LOCAL INPATH '" + unptn_locn + "' OVERWRITE INTO TABLE " + 
dbName + ".unptned", true, driver);
+    verifySetup("SELECT * from " + dbName + ".unptned", unptn_data, driver);
+
+    // Perform REPL-DUMP/LOAD
+    Tuple incrementalDump = incrementalLoadAndVerify(dbName, replDbName);
+
+    run("DESCRIBE DATABASE EXTENDED " + replDbName, driverMirror);
+    result = getOutput(driverMirror);
+    assertTrue(result.get(0), result.get(0).contains("repl.target.for=true"));

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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to