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

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

                Author: ASF GitHub Bot
            Created on: 18/Nov/22 15:26
            Start Date: 18/Nov/22 15:26
    Worklog Time Spent: 10m 
      Work Description: veghlaci05 commented on code in PR #3746:
URL: https://github.com/apache/hive/pull/3746#discussion_r1026570015


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java:
##########
@@ -203,19 +214,23 @@ CompactionQueryBuilder setIsDeleteDelta(boolean 
deleteDelta) {
    * @param resultTableName the name of the table we are running the operation 
on
    * @throws IllegalArgumentException if compactionType is null
    */
-  CompactionQueryBuilder(CompactionType compactionType, Operation operation,
+  CompactionQueryBuilder(CompactionType compactionType, Operation operation, 
boolean crud,
       String resultTableName) {
     if (compactionType == null) {
       throw new 
IllegalArgumentException("CompactionQueryBuilder.CompactionType cannot be 
null");
     }
+    this.compactionType = compactionType;
     this.operation = operation;
     this.resultTableName = resultTableName;
-    major = compactionType == CompactionType.MAJOR_CRUD
-        || compactionType == CompactionType.MAJOR_INSERT_ONLY;
-    crud =
-        compactionType == CompactionType.MAJOR_CRUD || compactionType == 
CompactionType.MINOR_CRUD;
-    minor = !major;
+    this.crud = crud;
     insertOnly = !crud;
+    major = compactionType.equals(CompactionType.MAJOR);
+    minor = compactionType.equals(CompactionType.MINOR);
+    rebalance = compactionType.equals(CompactionType.REBALANCE);

Review Comment:
   I modified the field sets.
   It is only for readability, imagine the following parts using enum 
comparison: 
   `
   if (rebalance || major && crud || major && insertOnly && sourcePartition != 
null || minor && insertOnly) {`
   
   `
   if (minor && crud && validWriteIdList != null) {`
   
   As for splitting this class, yes that's already on my list, I want to do a 
general refactoring task where I don't change any behavior just reorg the code. 
(Including changes like this and providing class dependencies through 
constructors for better testability.)





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

    Worklog Id:     (was: 827204)
    Time Spent: 4h 10m  (was: 4h)

> Query based Rebalance compaction on full acid tables
> ----------------------------------------------------
>
>                 Key: HIVE-26716
>                 URL: https://issues.apache.org/jira/browse/HIVE-26716
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: László Végh
>            Assignee: László Végh
>            Priority: Major
>              Labels: ACID, compaction, pull-request-available
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> Support rebalancing compaction on fully ACID tables.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to