From 64ffb06a793032f56d799fba22ebdf869f3a7b2a Mon Sep 17 00:00:00 2001 From: morrySnow <101034200+morrySnow@users.noreply.github.com> Date: Thu, 29 Jun 2023 09:12:08 +0800 Subject: [PATCH] [fix](Nereids) olap scan should not be gather since coordinator chould not process (#21298) in PR #21168 , we refactor physcial properties and translator to ensure not generating useless excahange. olap scan node could be gather in Nereids but translate to hash partitioned. since coordinator could not process gather olap scan node, we remove the candidate distribution spec of olap scan --- .../LogicalOlapScanToPhysicalOlapScan.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java index 40e0d0fbf2..12399722af 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalOlapScanToPhysicalOlapScan.java @@ -28,7 +28,6 @@ import org.apache.doris.nereids.properties.DistributionSpec; import org.apache.doris.nereids.properties.DistributionSpecHash; import org.apache.doris.nereids.properties.DistributionSpecHash.ShuffleType; import org.apache.doris.nereids.properties.DistributionSpecStorageAny; -import org.apache.doris.nereids.properties.DistributionSpecStorageGather; import org.apache.doris.nereids.rules.Rule; import org.apache.doris.nereids.rules.RuleType; import org.apache.doris.nereids.trees.expressions.ExprId; @@ -36,7 +35,6 @@ import org.apache.doris.nereids.trees.expressions.Slot; import org.apache.doris.nereids.trees.expressions.SlotReference; import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan; import org.apache.doris.nereids.trees.plans.physical.PhysicalOlapScan; -import org.apache.doris.qe.ConnectContext; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -77,12 +75,8 @@ public class LogicalOlapScanToPhysicalOlapScan extends OneImplementationRuleFact && !colocateTableIndex.isGroupUnstable(colocateTableIndex.getGroup(olapTable.getId())); boolean isSelectUnpartition = olapTable.getPartitionInfo().getType() == PartitionType.UNPARTITIONED || olapScan.getSelectedPartitionIds().size() == 1; - if (!olapScan.getTable().isColocateTable() && olapScan.getScanTabletNum() == 1 - && !isBelongStableCG - && !ConnectContext.get().getSessionVariable().enablePipelineEngine()) { - // TODO: find a better way to handle both tablet num == 1 and colocate table together in future - return DistributionSpecStorageGather.INSTANCE; - } else if (distributionInfo instanceof HashDistributionInfo && (isBelongStableCG || isSelectUnpartition)) { + // TODO: find a better way to handle both tablet num == 1 and colocate table together in future + if (distributionInfo instanceof HashDistributionInfo && (isBelongStableCG || isSelectUnpartition)) { if (olapScan.getSelectedIndexId() != olapScan.getTable().getBaseIndexId()) { HashDistributionInfo hashDistributionInfo = (HashDistributionInfo) distributionInfo; List output = olapScan.getOutput();