pvary commented on a change in pull request #2772:
URL: https://github.com/apache/hive/pull/2772#discussion_r760027429



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -1334,6 +1344,20 @@ public void dropTable(String tableName, boolean ifPurge) 
throws HiveException {
     dropTable(names[0], names[1], true, true, ifPurge);
   }
 
+  public void dropTable(Table table, boolean ifPurge) throws HiveException {
+    boolean tableWithSuffix = (HiveConf.getBoolVar(conf, 
ConfVars.HIVE_ACID_CREATE_TABLE_USE_SUFFIX)
+        || HiveConf.getBoolVar(conf, 
ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED))
+      && AcidUtils.isTransactionalTable(table)
+      && table.getSd().getLocation().matches(PATH_WITH_VERSION_ID);
+    
+    if (tableWithSuffix) {
+      long txnId = Optional.ofNullable(SessionState.get())
+        .map(ss -> ss.getTxnMgr().getCurrentTxnId()).orElse(0L);
+      table.getTTable().setTxnId(txnId);
+    }

Review comment:
       if the location is not PATH_WITH_VERSION_ID, we might have a situation 
were we are trying to do a softdelete, but could not do it. Do we need to 
handle this?




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

To unsubscribe, e-mail: [email protected]

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