morningman commented on a change in pull request #2821: The new materialized 
view selector
URL: https://github.com/apache/incubator-doris/pull/2821#discussion_r370970150
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/planner/OlapScanNode.java
 ##########
 @@ -130,6 +138,66 @@ public void setForceOpenPreAgg(boolean forceOpenPreAgg) {
         this.forceOpenPreAgg = forceOpenPreAgg;
     }
 
+    public Collection<Long> getSelectedPartitionIds() {
+        return selectedPartitionIds;
+    }
+
+    public void updateScanRangeInfo(long selectedIndexId, boolean 
isPreAggregation, String reasonOfDisable)
+            throws UserException {
+        if (selectedIndexId == this.selectedIndexId && isPreAggregation == 
this.isPreAggregation) {
+            return;
+        }
+        StringBuilder stringBuilder = new StringBuilder("The new selected 
index id ")
+                .append(selectedIndexId)
+                .append(", pre aggregation tag ").append(isPreAggregation)
+                .append(", reason ").append(reasonOfDisable == null ? "null" : 
reasonOfDisable)
+                .append(". The old selected index id 
").append(this.selectedIndexId)
+                .append(" pre aggregation tag ").append(this.isPreAggregation)
+                .append(" reason ").append(this.reasonOfPreAggregation == null 
? "null" : this.reasonOfPreAggregation);
+        String scanRangeInfo = stringBuilder.toString();
+        boolean updateScanRangeInfo;
+        String situation;
+        CHECK:
+        {
+            if (olapTable.getKeysType() == KeysType.DUP_KEYS) {
+                updateScanRangeInfo = true;
+                situation = "The key type of table is duplicate.";
+                break CHECK;
+            }
+            if (ConnectContext.get() == null) {
+                updateScanRangeInfo = true;
+                situation = "Connection context is null";
+                break CHECK;
+            }
+            SessionVariable sessionVariable = 
ConnectContext.get().getSessionVariable();
+            if (sessionVariable.getTestMaterializedView()) {
+                throw new AnalysisException("The old scan range info is 
different from the new one when "
+                                                    + "test_materialized_view 
is true."
 
 Review comment:
   ```suggestion
                                                       + 
"test_materialized_view is true. "
   ```

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