This is an automated email from the ASF dual-hosted git repository. jakevin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new f2fa62f5242 [minor](Nereids): cleanup code (#29413) f2fa62f5242 is described below commit f2fa62f5242ba45de9b22cfb0b271af79609e4df Author: jakevin <jakevin...@gmail.com> AuthorDate: Tue Jan 2 20:13:59 2024 +0800 [minor](Nereids): cleanup code (#29413) --- .../glue/translator/PhysicalPlanTranslator.java | 3 ++- .../doris/nereids/properties/DistributionSpec.java | 1 - .../trees/plans/physical/PhysicalDistribute.java | 4 ++-- .../org/apache/doris/planner/EmptySetNode.java | 1 - .../java/org/apache/doris/planner/PlanNode.java | 22 ---------------------- .../org/apache/doris/nereids/util/PlanChecker.java | 1 - 6 files changed, 4 insertions(+), 28 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 6ad21d34890..f8b23935318 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 @@ -313,10 +313,11 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla DataPartition dataPartition = toDataPartition(distribute.getDistributionSpec(), validOutputIds, context); exchangeNode.setPartitionType(dataPartition.getType()); PlanFragment parentFragment = new PlanFragment(context.nextFragmentId(), exchangeNode, dataPartition); - exchangeNode.setNumInstances(inputFragment.getPlanRoot().getNumInstances()); if (distribute.getDistributionSpec() instanceof DistributionSpecGather) { // gather to one instance exchangeNode.setNumInstances(1); + } else { + exchangeNode.setNumInstances(inputFragment.getPlanRoot().getNumInstances()); } // process multicast sink diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpec.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpec.java index f748d6e9e16..067a5dd328f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpec.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpec.java @@ -44,7 +44,6 @@ public abstract class DistributionSpec { // If we don't set LogicalProperties explicitly, node will compute a applicable LogicalProperties for itself. PhysicalDistribute<GroupPlan> distribution = new PhysicalDistribute<>( this, - child.getLogicalProperties(), new GroupPlan(child)); return new GroupExpression(distribution, Lists.newArrayList(child)); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java index e3b547dd884..d62225cdcd0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java @@ -52,8 +52,8 @@ public class PhysicalDistribute<CHILD_TYPE extends Plan> extends PhysicalUnary<C protected DistributionSpec distributionSpec; - public PhysicalDistribute(DistributionSpec spec, LogicalProperties logicalProperties, CHILD_TYPE child) { - this(spec, Optional.empty(), logicalProperties, child); + public PhysicalDistribute(DistributionSpec spec, CHILD_TYPE child) { + this(spec, Optional.empty(), child.getLogicalProperties(), child); } public PhysicalDistribute(DistributionSpec spec, Optional<GroupExpression> groupExpression, diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/EmptySetNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/EmptySetNode.java index e4b3cfd2264..867c220d9fe 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/EmptySetNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/EmptySetNode.java @@ -43,7 +43,6 @@ public class EmptySetNode extends PlanNode { public EmptySetNode(PlanNodeId id, ArrayList<TupleId> tupleIds) { super(id, tupleIds, "EMPTYSET", StatisticalType.EMPTY_SET_NODE); cardinality = 0L; - offset = 0; Preconditions.checkArgument(tupleIds.size() > 0); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java index a61e214f05f..3f32ee59060 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java @@ -28,15 +28,12 @@ import org.apache.doris.analysis.Expr; import org.apache.doris.analysis.ExprId; import org.apache.doris.analysis.ExprSubstitutionMap; import org.apache.doris.analysis.FunctionCallExpr; -import org.apache.doris.analysis.FunctionName; import org.apache.doris.analysis.SlotId; import org.apache.doris.analysis.SlotRef; import org.apache.doris.analysis.TupleDescriptor; import org.apache.doris.analysis.TupleId; import org.apache.doris.catalog.Column; -import org.apache.doris.catalog.Function; import org.apache.doris.catalog.OlapTable; -import org.apache.doris.catalog.Type; import org.apache.doris.common.AnalysisException; import org.apache.doris.common.NotImplementedException; import org.apache.doris.common.TreeNode; @@ -45,7 +42,6 @@ import org.apache.doris.statistics.PlanStats; import org.apache.doris.statistics.StatisticalType; import org.apache.doris.statistics.StatsDeriveResult; import org.apache.doris.thrift.TExplainLevel; -import org.apache.doris.thrift.TFunctionBinaryType; import org.apache.doris.thrift.TPlan; import org.apache.doris.thrift.TPlanNode; import org.apache.doris.thrift.TPushAggOp; @@ -405,24 +401,6 @@ public abstract class PlanNode extends TreeNode<PlanNode> implements PlanStats { return statsDeriveResultList; } - protected void initCompoundPredicate(Expr expr) { - if (expr instanceof CompoundPredicate) { - CompoundPredicate compoundPredicate = (CompoundPredicate) expr; - compoundPredicate.setType(Type.BOOLEAN); - List<Type> args = new ArrayList<>(); - args.add(Type.BOOLEAN); - args.add(Type.BOOLEAN); - Function function = new Function(new FunctionName("", compoundPredicate.getOp().toString()), - args, Type.BOOLEAN, false); - function.setBinaryType(TFunctionBinaryType.BUILTIN); - expr.setFn(function); - } - - for (Expr child : expr.getChildren()) { - initCompoundPredicate(child); - } - } - public static Expr convertConjunctsToAndCompoundPredicate(List<Expr> conjuncts) { List<Expr> targetConjuncts = Lists.newArrayList(conjuncts); while (targetConjuncts.size() > 1) { diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java index afdc5a8769a..60713bd5354 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/PlanChecker.java @@ -259,7 +259,6 @@ public class PlanChecker { PhysicalQuickSort<? extends Plan> sort = (PhysicalQuickSort) plan; plan = sort.withChildren(new PhysicalDistribute<>( DistributionSpecGather.INSTANCE, - plan.child(0).getLogicalProperties(), plan.child(0))); } physicalPlan = ((PhysicalPlan) plan); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org