[minor](Nereids): cleanup code (#29413)
This commit is contained in:
@ -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
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user