This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 140e6d1f5b [Fix](PhysicalPlanTranslator) forget 
setPushDownAggNoGrouping in OlapScanNode (#23675) (#23699)
140e6d1f5b is described below

commit 140e6d1f5b915ec59c4ad5bd8ee11dfb2645b1af
Author: airborne12 <[email protected]>
AuthorDate: Thu Aug 31 18:51:15 2023 +0800

    [Fix](PhysicalPlanTranslator) forget setPushDownAggNoGrouping in 
OlapScanNode (#23675) (#23699)
---
 .../doris/nereids/glue/translator/PhysicalPlanTranslator.java |  8 ++++----
 .../doris/nereids/glue/translator/PlanTranslatorContext.java  | 11 ++++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
index b0734abc5f..406dda5485 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
@@ -91,7 +91,6 @@ import 
org.apache.doris.nereids.trees.plans.physical.PhysicalAssertNumRows;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalCTEAnchor;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalCTEConsumer;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalCTEProducer;
-import org.apache.doris.nereids.trees.plans.physical.PhysicalCatalogRelation;
 import 
org.apache.doris.nereids.trees.plans.physical.PhysicalDeferMaterializeOlapScan;
 import 
org.apache.doris.nereids.trees.plans.physical.PhysicalDeferMaterializeResultSink;
 import 
org.apache.doris.nereids.trees.plans.physical.PhysicalDeferMaterializeTopN;
@@ -428,7 +427,7 @@ public class PhysicalPlanTranslator extends 
DefaultPlanVisitor<PlanFragment, Pla
         }
 
         
scanNode.addConjuncts(translateToLegacyConjuncts(fileScan.getConjuncts()));
-        
scanNode.setPushDownAggNoGrouping(context.getTablePushAggOp(table.getId()));
+        
scanNode.setPushDownAggNoGrouping(context.getRelationPushAggOp(fileScan.getRelationId()));
 
         TableName tableName = new TableName(null, "", "");
         TableRef ref = new TableRef(tableName, null, null);
@@ -564,6 +563,7 @@ public class PhysicalPlanTranslator extends 
DefaultPlanVisitor<PlanFragment, Pla
                                 expr, olapScanNode, context)
                 )
         );
+        
olapScanNode.setPushDownAggNoGrouping(context.getRelationPushAggOp(olapScan.getRelationId()));
         // TODO: we need to remove all finalizeForNereids
         olapScanNode.finalizeForNereids();
         // Create PlanFragment
@@ -808,8 +808,8 @@ public class PhysicalPlanTranslator extends 
DefaultPlanVisitor<PlanFragment, Pla
                         + storageLayerAggregate.getAggOp());
         }
 
-        context.setTablePushAggOp(
-                ((PhysicalCatalogRelation) 
storageLayerAggregate.getRelation()).getTable().getId(), pushAggOp);
+        context.setRelationPushAggOp(
+                storageLayerAggregate.getRelation().getRelationId(), 
pushAggOp);
 
         PlanFragment planFragment = 
storageLayerAggregate.getRelation().accept(this, context);
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PlanTranslatorContext.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PlanTranslatorContext.java
index 7617402127..256b37d705 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PlanTranslatorContext.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PlanTranslatorContext.java
@@ -32,6 +32,7 @@ import org.apache.doris.nereids.trees.expressions.CTEId;
 import org.apache.doris.nereids.trees.expressions.ExprId;
 import org.apache.doris.nereids.trees.expressions.SlotReference;
 import org.apache.doris.nereids.trees.expressions.VirtualSlotReference;
+import org.apache.doris.nereids.trees.plans.RelationId;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalCTEProducer;
 import org.apache.doris.nereids.trees.plans.physical.PhysicalHashAggregate;
 import org.apache.doris.planner.PlanFragment;
@@ -88,7 +89,7 @@ public class PlanTranslatorContext {
 
     private final Map<CTEId, PhysicalCTEProducer> cteProducerMap = 
Maps.newHashMap();
 
-    private final Map<Long, TPushAggOp> tablePushAggOp = Maps.newHashMap();
+    private final Map<RelationId, TPushAggOp> tablePushAggOp = 
Maps.newHashMap();
 
     public PlanTranslatorContext(CascadesContext ctx) {
         this.translator = new 
RuntimeFilterTranslator(ctx.getRuntimeFilterContext());
@@ -225,11 +226,11 @@ public class PlanTranslatorContext {
         return descTable;
     }
 
-    public void setTablePushAggOp(Long tableId, TPushAggOp aggOp) {
-        tablePushAggOp.put(tableId, aggOp);
+    public void setRelationPushAggOp(RelationId relationId, TPushAggOp aggOp) {
+        tablePushAggOp.put(relationId, aggOp);
     }
 
-    public TPushAggOp getTablePushAggOp(Long tableId) {
-        return tablePushAggOp.getOrDefault(tableId, TPushAggOp.NONE);
+    public TPushAggOp getRelationPushAggOp(RelationId relationId) {
+        return tablePushAggOp.getOrDefault(relationId, TPushAggOp.NONE);
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to