veghlaci05 commented on code in PR #3746:
URL: https://github.com/apache/hive/pull/3746#discussion_r1033469202


##########
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 / CEIL(numRows / ");

Review Comment:
   I have checked TxnQueries and it contains only parameterless whole queries. 
I think moving these small fragments there would greatly reduce code 
readability without any real benefit on the other side.



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