[minor](Nereids): cleanup code (#29413)

This commit is contained in:
jakevin
2024-01-02 20:13:59 +08:00
committed by GitHub
parent af39217d14
commit f2fa62f524
6 changed files with 4 additions and 28 deletions

View File

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

View File

@ -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));
}

View File

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

View File

@ -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);
}

View File

@ -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) {

View File

@ -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);