[ 
https://issues.apache.org/jira/browse/HIVE-24445?focusedWorklogId=688561&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-688561
 ]

ASF GitHub Bot logged work on HIVE-24445:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Dec/21 10:23
            Start Date: 01/Dec/21 10:23
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2772:
URL: https://github.com/apache/hive/pull/2772#discussion_r760045866



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java
##########
@@ -60,9 +65,30 @@ public void onDropDatabase (DropDatabaseEvent dbEvent) 
throws MetaException {
 
   @Override
   public void onDropTable(DropTableEvent tableEvent)  throws MetaException {
-    if (TxnUtils.isTransactionalTable(tableEvent.getTable())) {
+    Table table = tableEvent.getTable();
+    
+    if (TxnUtils.isTransactionalTable(table)) {
       txnHandler = getTxnHandler();
-      txnHandler.cleanupRecords(HiveObjectType.TABLE, null, 
tableEvent.getTable(), null);
+      txnHandler.cleanupRecords(HiveObjectType.TABLE, null, table, null, 
!tableEvent.getDeleteData());
+      
+      if (!tableEvent.getDeleteData()) {
+        long currentTxn = 
Optional.ofNullable(tableEvent.getEnvironmentContext())
+          .map(EnvironmentContext::getProperties)
+          .map(prop -> prop.get("txnId"))
+          .map(Long::parseLong)
+          .orElse(0L);
+
+        if (currentTxn > 0) {
+          CompactionRequest rqst = new CompactionRequest(table.getDbName(), 
table.getTableName(), CompactionType.MAJOR);
+          rqst.putToProperties("location", table.getSd().getLocation());

Review comment:
       Why properties, and not optional field?
   




-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 688561)
    Time Spent: 7h 40m  (was: 7.5h)

> Non blocking DROP TABLE implementation
> --------------------------------------
>
>                 Key: HIVE-24445
>                 URL: https://issues.apache.org/jira/browse/HIVE-24445
>             Project: Hive
>          Issue Type: New Feature
>          Components: Hive
>            Reporter: Zoltan Chovan
>            Assignee: Denys Kuzmenko
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 7h 40m
>  Remaining Estimate: 0h
>
> Implement a way to execute drop table operations in a way that doesn't have 
> to wait for currently running read operations to be finished.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to