Skip to content

Commit

Permalink
[opt](Nereids) use 1 instead narrowest column when do column pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
morrySnow committed Oct 8, 2024
1 parent 4b8375f commit 9454ee5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.functions.NoneMovableFunction;
import org.apache.doris.nereids.trees.expressions.functions.scalar.Uuid;
import org.apache.doris.nereids.trees.expressions.literal.TinyIntLiteral;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.PlanType;
import org.apache.doris.nereids.trees.plans.algebra.Project;
Expand Down Expand Up @@ -85,7 +86,7 @@ private LogicalProject(List<NamedExpression> projects, boolean isDistinct,
Preconditions.checkArgument(!projects.isEmpty() || !(child instanceof Unbound),
"projects can not be empty when child plan is unbound");
this.projects = projects.isEmpty()
? ImmutableList.of(ExpressionUtils.selectMinimumColumn(child.get(0).getOutput()))
? ImmutableList.of(new Alias(new TinyIntLiteral((byte) 1)))
: projects;
this.projectsSet = Suppliers.memoize(() -> ImmutableSet.copyOf(this.projects));
this.isDistinct = isDistinct;
Expand Down

0 comments on commit 9454ee5

Please sign in to comment.