imay commented on a change in pull request #2294: Add convert tablet rowset type
URL: https://github.com/apache/incubator-doris/pull/2294#discussion_r357445496
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/planner/RollupSelector.java
 ##########
 @@ -95,6 +96,27 @@ private long selectBestRowCountRollup(List<Long> 
bestPrefixIndexRollups, Collect
                 }
             }
         }
+        String tableName = table.getName();
+        String v2RollupIndexName = "__v2_" + tableName;
+        Long v2RollupIndex = table.getIndexIdByName(v2RollupIndexName);
+        long baseIndexId = table.getBaseIndexId();
+        ConnectContext connectContext = ConnectContext.get();
+        boolean useV2Rollup = false;
+        if (connectContext != null) {
+            useV2Rollup = connectContext.getSessionVariable().getUseV2Rollup();
+        }
+        if (baseIndexId == selectedIndexId && v2RollupIndex != null && 
useV2Rollup) {
+            // if the selectedIndexId is baseIndexId
+            // check whether there is a V2 rollup index and useV2Rollup flag 
is true,
+            // if both true, use v2 rollup index
+            selectedIndexId = v2RollupIndex;
+        }
+        if (!useV2Rollup && v2RollupIndex != null && v2RollupIndex == 
selectedIndexId) {
 
 Review comment:
   Seems that this if clause is unnecessary.
   If this clause is true `useV2Rollup` must be false. 
   If `v2RollupIndex == selectedIndexId`, above if clause must be true, then 
`useV2Rollup` must be true.
   This leads to conflict.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to