[ https://issues.apache.org/jira/browse/HIVE-26716?focusedWorklogId=825734&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-825734 ]
ASF GitHub Bot logged work on HIVE-26716: ----------------------------------------- Author: ASF GitHub Bot Created on: 14/Nov/22 12:34 Start Date: 14/Nov/22 12:34 Worklog Time Spent: 10m Work Description: veghlaci05 commented on code in PR #3746: URL: https://github.com/apache/hive/pull/3746#discussion_r1021470141 ########## ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java: ########## @@ -287,16 +302,27 @@ private void buildAddClauseForAlter(StringBuilder query) { private void buildSelectClauseForInsert(StringBuilder query) { // Need list of columns for major crud, mmmajor partitioned, mmminor List<FieldSchema> cols; - if (major && crud || major && insertOnly && sourcePartition != null || minor && insertOnly) { + if (rebalance || major && crud || major && insertOnly && sourcePartition != null || minor && insertOnly) { if (sourceTab == null) { return; // avoid NPEs, don't throw an exception but skip this part of the query } cols = sourceTab.getSd().getCols(); } else { cols = null; } - - if (crud) { + if (rebalance) { + query.append("0, t2.writeId, t2.rowId % "); + query.append(numberOfBuckets); Review Comment: Yes, in order to equally distribute the records among the buckets, the row_number % numberOfBuckets is used. Issue Time Tracking ------------------- Worklog Id: (was: 825734) Time Spent: 1h 50m (was: 1h 40m) > 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: 1h 50m > Remaining Estimate: 0h > > Support rebalancing compaction on fully ACID tables. -- This message was sent by Atlassian Jira (v8.20.10#820010)