maheshk114 commented on a change in pull request #620: HIVE-21706: REPL Dump 
with concurrent drop of external table fails with InvalidTableException.
URL: https://github.com/apache/hive/pull/620#discussion_r283170843
 
 

 ##########
 File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java
 ##########
 @@ -712,6 +712,64 @@ public void testExternalTableDataPath() throws Exception {
     
assertTrue(dataPath.toUri().getPath().equalsIgnoreCase("/tmp/tmp1/abc/xyz"));
   }
 
+  @Test
+  public void testExternalTablesIncReplicationWithConcurrentDropTable() throws 
Throwable {
+    List<String> dumpWithClause = Collections.singletonList(
+            "'" + HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES.varname + 
"'='true'"
+    );
+    List<String> loadWithClause = externalTableBasePathWithClause();
+    WarehouseInstance.Tuple tupleBootstrap = primary.run("use " + 
primaryDbName)
+            .run("create external table t1 (id int)")
+            .run("insert into table t1 values (1)")
+            .dump(primaryDbName, null, dumpWithClause);
+
+    replica.load(replicatedDbName, tupleBootstrap.dumpLocation, 
loadWithClause);
+
+    // Insert a row into "t1" and create another external table using data 
from "t1".
+    primary.run("use " + primaryDbName)
+            .run("insert into table t1 values (2)")
+            .run("create external table t2 as select * from t1");
+
+    // Inject a behavior so that getTable returns null for table "t1". This 
ensures the table is
+    // skipped for data files listing.
+    BehaviourInjection<Table, Table> ptnedTableNuller = new 
BehaviourInjection<Table, Table>() {
 
 Review comment:
   ptnedTableNuller is not proper. 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to