[minor](Nereids): remove useless override (#33651)

This commit is contained in:
jakevin
2024-04-16 12:30:19 +08:00
committed by yiguolei
parent 16e9eb3b05
commit 11266dd9b8
5 changed files with 17 additions and 25 deletions

View File

@ -26,9 +26,13 @@ import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
import org.apache.doris.nereids.util.MutableState;
import org.apache.doris.nereids.util.MutableState.MultiMutableState;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
* Used for unit test only.
@ -88,7 +92,12 @@ public class FakePlan implements Plan {
@Override
public List<Slot> getOutput() {
return new ArrayList<>();
return ImmutableList.of();
}
@Override
public Set<Slot> getOutputSet() {
return ImmutableSet.of();
}
@Override

View File

@ -98,9 +98,7 @@ public interface Plan extends TreeNode<Plan> {
/**
* Get output slot set of the plan.
*/
default Set<Slot> getOutputSet() {
return ImmutableSet.copyOf(getOutput());
}
Set<Slot> getOutputSet();
/** getOutputExprIds */
default List<ExprId> getOutputExprIds() {

View File

@ -33,6 +33,7 @@ import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
* All DDL and DML commands' super class.
@ -101,6 +102,11 @@ public abstract class Command extends AbstractPlan implements LogicalPlan, Block
throw new RuntimeException("Command do not implement getOutput");
}
@Override
public Set<Slot> getOutputSet() {
throw new RuntimeException("Command do not implement getOutputSet");
}
@Override
public String treeString() {
throw new RuntimeException("Command do not implement treeString");

View File

@ -29,7 +29,6 @@ import org.apache.doris.nereids.properties.LogicalProperties;
import org.apache.doris.nereids.properties.PhysicalProperties;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.PlanType;
import org.apache.doris.nereids.trees.plans.algebra.Sink;
@ -40,12 +39,10 @@ import org.apache.doris.statistics.Statistics;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
/**
* physical olap table sink for insert command
@ -165,19 +162,6 @@ public class PhysicalOlapTableSink<CHILD_TYPE extends Plan> extends PhysicalTabl
);
}
@Override
public List<Slot> getOutput() {
return computeOutput();
}
/**
* override function of AbstractPlan.
*/
@Override
public Set<Slot> getOutputSet() {
return ImmutableSet.copyOf(getOutput());
}
@Override
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
return visitor.visitPhysicalOlapTableSink(this, context);

View File

@ -315,9 +315,4 @@ public class PhysicalProject<CHILD_TYPE extends Plan> extends PhysicalUnary<CHIL
public void setMultiLayerProjects(List<List<NamedExpression>> multiLayers) {
this.multiLayerProjects = multiLayers;
}
@Override
public List<Slot> getOutput() {
return computeOutput();
}
}