[
https://issues.apache.org/jira/browse/HIVE-22977?focusedWorklogId=837474&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-837474
]
ASF GitHub Bot logged work on HIVE-22977:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Jan/23 13:07
Start Date: 06/Jan/23 13:07
Worklog Time Spent: 10m
Work Description: veghlaci05 commented on code in PR #3801:
URL: https://github.com/apache/hive/pull/3801#discussion_r1063270238
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/QueryCompactor.java:
##########
@@ -281,5 +283,146 @@ static void overrideConfProps(HiveConf conf,
CompactionInfo ci, Map<String, Stri
conf.set(property, entry.getValue());
});
}
+
+ /**
+ * Returns whether merge compaction must be enabled or not.
+ * @param conf Hive configuration
+ * @param directory the directory to be scanned
+ * @param validWriteIdList list of valid write IDs
+ * @param storageDescriptor storage descriptor of the underlying table
+ * @return true, if merge compaction must be enabled
+ */
+ static boolean isMergeCompaction(HiveConf conf, AcidDirectory directory,
+ ValidWriteIdList validWriteIdList,
+ StorageDescriptor storageDescriptor) {
+ return conf.getBoolVar(HiveConf.ConfVars.HIVE_MERGE_COMPACTION_ENABLED)
+ && !hasDeleteOrAbortedDirectories(directory, validWriteIdList)
Review Comment:
Please switch the last two conditions. Due to the short circuit evaluation,
the expensive hasDeleteOrAbortedDirectories will be called only if the other
two are true.
Issue Time Tracking
-------------------
Worklog Id: (was: 837474)
Time Spent: 1.5h (was: 1h 20m)
> Merge delta files instead of running a query in major/minor compaction
> ----------------------------------------------------------------------
>
> Key: HIVE-22977
> URL: https://issues.apache.org/jira/browse/HIVE-22977
> Project: Hive
> Issue Type: Improvement
> Reporter: László Pintér
> Assignee: Sourabh Badhya
> Priority: Major
> Labels: pull-request-available
> Attachments: HIVE-22977.01.patch, HIVE-22977.02.patch
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> [Compaction Optimiziation]
> We should analyse the possibility to move a delta file instead of running a
> major/minor compaction query.
> Please consider the following use cases:
> - full acid table but only insert queries were run. This means that no
> delete delta directories were created. Is it possible to merge the delta
> directory contents without running a compaction query?
> - full acid table, initiating queries through the streaming API. If there
> are no abort transactions during the streaming, is it possible to merge the
> delta directory contents without running a compaction query?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)