[ https://issues.apache.org/jira/browse/HIVE-24933?focusedWorklogId=798289&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-798289 ]
ASF GitHub Bot logged work on HIVE-24933: ----------------------------------------- Author: ASF GitHub Bot Created on: 05/Aug/22 06:48 Start Date: 05/Aug/22 06:48 Worklog Time Spent: 10m Work Description: jhungund commented on code in PR #3435: URL: https://github.com/apache/hive/pull/3435#discussion_r938496746 ########## itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java: ########## @@ -3408,4 +3411,83 @@ public void testTableWithPartitionsInBatch() throws Throwable { .verifyResults(new String[] { "bangalore", "paris", "sydney" }) .verifyReplTargetProperty(replicatedDbName); } + + + @Test + public void testTxnTblReplWithSameNameAsDroppedNonTxnTbl() throws Throwable { + List<String> withClauseOptions = new LinkedList<>(); + withClauseOptions.add("'" + HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER.varname + + "'='" + UserGroupInformation.getCurrentUser().getUserName() + "'"); + + String tbl = "t1"; + primary + .run("use " + primaryDbName) + .run("create table " + tbl + " (id int)") + .run("insert into table " + tbl + " values (1)") + .dump(primaryDbName, withClauseOptions); + + replica + .load(replicatedDbName, primaryDbName) + .run("use " + replicatedDbName) + .run("select id from " + tbl) + .verifyResults(new String[] {"1"}); + + assertFalse(AcidUtils.isTransactionalTable(replica.getTable(replicatedDbName, tbl))); + + primary + .run("use " + primaryDbName) + .run("drop table " + tbl) + .run("create table " + tbl + " (id int) clustered by(id) into 3 buckets stored as orc " + + "tblproperties (\"transactional\"=\"true\")") + .run("insert into table " + tbl + " values (2)") + .dump(primaryDbName, withClauseOptions); + + replica + .load(replicatedDbName, primaryDbName) + .run("use " + replicatedDbName) + .run("select id from " + tbl) + .verifyResults(new String[] {"2"}); + + assertTrue(AcidUtils.isTransactionalTable(replica.getTable(replicatedDbName, tbl))); + } + + @Test + public void testTxnTblReplWithSameNameAsDroppedExtTbl() throws Throwable { Review Comment: Test testTxnTblReplWithSameNameAsDroppedNonTxnTbl verifies the drop of a non-ACID managed table and the recreation a managed ACID table. Test testTxnTblReplWithSameNameAsDroppedExtTbl verifies the drop of an external table and a recreation of a managed ACID table. Issue Time Tracking ------------------- Worklog Id: (was: 798289) Time Spent: 3h (was: 2h 50m) > Replication fails for transactional tables having same name as dropped > non-transactional table > ---------------------------------------------------------------------------------------------- > > Key: HIVE-24933 > URL: https://issues.apache.org/jira/browse/HIVE-24933 > Project: Hive > Issue Type: Bug > Reporter: Pratyush Madhukar > Assignee: Pratyush Madhukar > Priority: Major > Labels: pull-request-available > Time Spent: 3h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.10#820010)