[Performance](Nereids): add withGroupExprLogicalPropChildren to reduce new Plan (#21477)
This commit is contained in:
@ -35,7 +35,7 @@ public class PlanContext {
|
||||
|
||||
private List<Statistics> childrenStats = new ArrayList<>();
|
||||
private Statistics planStats;
|
||||
private int arity = 0;
|
||||
private final int arity;
|
||||
private boolean isBroadcastJoin = false;
|
||||
|
||||
/**
|
||||
@ -47,7 +47,7 @@ public class PlanContext {
|
||||
return;
|
||||
}
|
||||
planStats = groupExpression.getOwnerGroup().getStatistics();
|
||||
childrenStats = new ArrayList<>();
|
||||
childrenStats = new ArrayList<>(groupExpression.arity());
|
||||
for (int i = 0; i < groupExpression.arity(); i++) {
|
||||
childrenStats.add(groupExpression.childStatistics(i));
|
||||
}
|
||||
|
||||
@ -119,6 +119,13 @@ public class UnboundOlapTableSink<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new UnboundOlapTableSink<>(nameParts, colNames, hints, partitions, groupExpression,
|
||||
logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogicalProperties computeLogicalProperties() {
|
||||
return UnboundLogicalProperties.INSTANCE;
|
||||
|
||||
@ -92,6 +92,12 @@ public class UnboundOneRowRelation extends LogicalLeaf implements Unbound, OneRo
|
||||
return new UnboundOneRowRelation(id, projects, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new UnboundOneRowRelation(id, projects, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
throw new UnboundException("output");
|
||||
|
||||
@ -104,6 +104,13 @@ public class UnboundRelation extends LogicalRelation implements Unbound {
|
||||
isTempPart, hints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new UnboundRelation(id, nameParts, groupExpression, logicalProperties, partNames,
|
||||
isTempPart, hints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
throw new UnboundException("output");
|
||||
|
||||
@ -104,6 +104,12 @@ public class UnboundTVFRelation extends LogicalLeaf implements TVFRelation, Unbo
|
||||
return new UnboundTVFRelation(id, functionName, properties, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new UnboundTVFRelation(id, functionName, properties, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toSqlString("UnboundTVFRelation",
|
||||
|
||||
@ -282,10 +282,10 @@ public class Memo {
|
||||
Preconditions.checkArgument(!(plan instanceof GroupPlan), "Cannot init memo by a GroupPlan");
|
||||
|
||||
// initialize children recursively
|
||||
List<Group> childrenGroups = plan.children()
|
||||
.stream()
|
||||
.map(this::init)
|
||||
.collect(ImmutableList.toImmutableList());
|
||||
List<Group> childrenGroups = new ArrayList<>(plan.arity());
|
||||
for (Plan child : plan.children()) {
|
||||
childrenGroups.add(init(child));
|
||||
}
|
||||
|
||||
plan = replaceChildrenToGroupPlan(plan, childrenGroups);
|
||||
GroupExpression newGroupExpression = new GroupExpression(plan, childrenGroups);
|
||||
|
||||
@ -170,9 +170,8 @@ public class GroupExpressionMatching implements Iterable<Plan> {
|
||||
// assemble children: replace GroupPlan to real plan,
|
||||
// withChildren will erase groupExpression, so we must
|
||||
// withGroupExpression too.
|
||||
Plan rootWithChildren = root.withChildren(children)
|
||||
.withLogicalProperties(Optional.of(logicalProperties))
|
||||
.withGroupExpression(Optional.of(groupExpression));
|
||||
Plan rootWithChildren = root.withGroupExprLogicalPropChildren(Optional.of(groupExpression),
|
||||
Optional.of(logicalProperties), children);
|
||||
if (rootPattern.matchPredicates(rootWithChildren)) {
|
||||
results.add(rootWithChildren);
|
||||
}
|
||||
|
||||
@ -173,6 +173,12 @@ public class MultiJoin extends AbstractLogicalPlan {
|
||||
throw new RuntimeException("multiJoin can't invoke withLogicalProperties");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
throw new RuntimeException("multiJoin can't invoke withGroupExprLogicalPropChildren");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toSqlString("MultiJoin",
|
||||
|
||||
@ -105,6 +105,12 @@ public class FakePlan implements Plan {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Optional<T> getMutableState(String key) {
|
||||
return (Optional<T>) Optional.ofNullable(mutableState.get(key));
|
||||
|
||||
@ -84,6 +84,12 @@ public class GroupPlan extends LogicalLeaf {
|
||||
throw new IllegalStateException("GroupPlan can not invoke withLogicalProperties()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
throw new IllegalStateException("GroupPlan can not invoke withGroupExprLogicalPropChildren()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
throw new IllegalStateException("GroupPlan can not compute output."
|
||||
|
||||
@ -129,6 +129,9 @@ public interface Plan extends TreeNode<Plan> {
|
||||
|
||||
Plan withLogicalProperties(Optional<LogicalProperties> logicalProperties);
|
||||
|
||||
Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children);
|
||||
|
||||
<T> Optional<T> getMutableState(String key);
|
||||
|
||||
/** getOrInitMutableState */
|
||||
|
||||
@ -98,6 +98,12 @@ public abstract class Command extends AbstractPlan implements LogicalPlan {
|
||||
throw new RuntimeException("Command do not implement getLogicalProperties");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
throw new RuntimeException("Command do not implement withGroupExprLogicalPropChildren");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBind() {
|
||||
throw new RuntimeException("Command do not implement canResolve");
|
||||
|
||||
@ -256,6 +256,13 @@ public class LogicalAggregate<CHILD_TYPE extends Plan>
|
||||
hasPushed, sourceRepeat, Optional.empty(), logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalAggregate<>(groupByExpressions, outputExpressions, normalized, ordinalIsResolved, generated,
|
||||
hasPushed, sourceRepeat, groupExpression, Optional.of(getLogicalProperties()), children.get(0));
|
||||
}
|
||||
|
||||
public LogicalAggregate<Plan> withGroupByAndOutput(List<Expression> groupByExprList,
|
||||
List<NamedExpression> outputExpressionList) {
|
||||
return new LogicalAggregate<>(groupByExprList, outputExpressionList, normalized, ordinalIsResolved, generated,
|
||||
|
||||
@ -221,4 +221,12 @@ public class LogicalApply<LEFT_CHILD_TYPE extends Plan, RIGHT_CHILD_TYPE extends
|
||||
correlationSlot, subqueryExpr, correlationFilter,
|
||||
markJoinSlotReference, subCorrespondingConjunct, needAddSubOutputToProjects, left(), right());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalApply<>(groupExpression, logicalProperties, correlationSlot, subqueryExpr, correlationFilter,
|
||||
markJoinSlotReference, subCorrespondingConjunct, needAddSubOutputToProjects, children.get(0),
|
||||
children.get(1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,6 +109,13 @@ public class LogicalAssertNumRows<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
return new LogicalAssertNumRows<>(assertNumRowsElement, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalAssertNumRows<>(assertNumRowsElement,
|
||||
groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return ImmutableList.<Slot>builder()
|
||||
|
||||
@ -151,6 +151,13 @@ public class LogicalCTE<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYPE
|
||||
cteNameToId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalCTE<>(aliasQueries, groupExpression, logicalProperties, children.get(0),
|
||||
registered, cteNameToId);
|
||||
}
|
||||
|
||||
public boolean isRegistered() {
|
||||
return registered;
|
||||
}
|
||||
|
||||
@ -77,6 +77,12 @@ public class LogicalCTEAnchor<LEFT_CHILD_TYPE extends Plan,
|
||||
return new LogicalCTEAnchor<>(groupExpression, logicalProperties, left(), right(), cteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalCTEAnchor<>(groupExpression, logicalProperties, children.get(0), children.get(1), cteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return right().getOutput();
|
||||
|
||||
@ -125,6 +125,15 @@ public class LogicalCTEConsumer extends LogicalLeaf {
|
||||
consumerId, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalCTEConsumer(groupExpression, logicalProperties, cteId,
|
||||
consumerToProducerOutputMap,
|
||||
producerToConsumerOutputMap,
|
||||
consumerId, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return ImmutableList.copyOf(producerToConsumerOutputMap.values());
|
||||
|
||||
@ -36,8 +36,7 @@ import java.util.Optional;
|
||||
/**
|
||||
* LogicalCTEProducer
|
||||
*/
|
||||
public class LogicalCTEProducer<CHILD_TYPE extends Plan>
|
||||
extends LogicalUnary<CHILD_TYPE> {
|
||||
public class LogicalCTEProducer<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYPE> {
|
||||
|
||||
private final CTEId cteId;
|
||||
|
||||
@ -104,6 +103,13 @@ public class LogicalCTEProducer<CHILD_TYPE extends Plan>
|
||||
projects, rewritten);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalCTEProducer<>(groupExpression, logicalProperties, children.get(0), cteId,
|
||||
projects, rewritten);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return child().computeOutput();
|
||||
|
||||
@ -104,6 +104,12 @@ public class LogicalCheckPolicy<CHILD_TYPE extends Plan> extends LogicalUnary<CH
|
||||
return new LogicalCheckPolicy<>(Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalCheckPolicy<>(groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withChildren(List<Plan> children) {
|
||||
Preconditions.checkArgument(children.size() == 1);
|
||||
|
||||
@ -82,6 +82,12 @@ public class LogicalEmptyRelation extends LogicalLeaf implements EmptyRelation,
|
||||
return new LogicalEmptyRelation(projects, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalEmptyRelation(projects, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return projects.stream()
|
||||
|
||||
@ -21,6 +21,7 @@ import org.apache.doris.catalog.external.ExternalTable;
|
||||
import org.apache.doris.nereids.memo.GroupExpression;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -75,6 +76,12 @@ public class LogicalEsScan extends LogicalRelation {
|
||||
logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalEsScan(id, (ExternalTable) table, qualifier, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
|
||||
return visitor.visitLogicalEsScan(this, context);
|
||||
|
||||
@ -76,6 +76,12 @@ public class LogicalExcept extends LogicalSetOperation {
|
||||
Optional.empty(), logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalExcept(qualifier, outputs, groupExpression, logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogicalExcept withNewOutputs(List<NamedExpression> newOutputs) {
|
||||
return new LogicalExcept(qualifier, newOutputs, Optional.empty(), Optional.empty(), children);
|
||||
|
||||
@ -22,6 +22,7 @@ import org.apache.doris.nereids.memo.GroupExpression;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.trees.expressions.Expression;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -88,6 +89,12 @@ public class LogicalFileScan extends LogicalRelation {
|
||||
logicalProperties, conjuncts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalFileScan(id, (ExternalTable) table, qualifier, groupExpression, logicalProperties, conjuncts);
|
||||
}
|
||||
|
||||
public LogicalFileScan withConjuncts(Set<Expression> conjuncts) {
|
||||
return new LogicalFileScan(id, (ExternalTable) table, qualifier, groupExpression,
|
||||
Optional.of(getLogicalProperties()), conjuncts);
|
||||
|
||||
@ -131,6 +131,12 @@ public class LogicalFilter<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
return new LogicalFilter<>(conjuncts, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalFilter<>(conjuncts, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
public LogicalFilter<Plan> withConjunctsAndChild(Set<Expression> conjuncts, Plan child) {
|
||||
return new LogicalFilter<>(conjuncts, child);
|
||||
}
|
||||
|
||||
@ -96,6 +96,12 @@ public class LogicalGenerate<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD
|
||||
Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalGenerate<>(generators, generatorOutput, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return ImmutableList.<Slot>builder()
|
||||
|
||||
@ -38,6 +38,7 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* Logical Having plan
|
||||
*
|
||||
* @param <CHILD_TYPE> Types which inherit from {@link Plan}
|
||||
*/
|
||||
public class LogicalHaving<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYPE> implements Filter {
|
||||
@ -84,6 +85,12 @@ public class LogicalHaving<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
return new LogicalHaving<>(conjuncts, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalHaving<>(conjuncts, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
public Plan withExpressions(Set<Expression> expressions) {
|
||||
return new LogicalHaving<Plan>(expressions, Optional.empty(),
|
||||
Optional.of(getLogicalProperties()), child());
|
||||
|
||||
@ -77,6 +77,12 @@ public class LogicalIntersect extends LogicalSetOperation {
|
||||
Optional.empty(), logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalIntersect(qualifier, outputs, groupExpression, logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogicalIntersect withNewOutputs(List<NamedExpression> newOutputs) {
|
||||
return new LogicalIntersect(qualifier, newOutputs,
|
||||
|
||||
@ -23,6 +23,7 @@ import org.apache.doris.catalog.external.ExternalTable;
|
||||
import org.apache.doris.nereids.memo.GroupExpression;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -78,6 +79,12 @@ public class LogicalJdbcScan extends LogicalRelation {
|
||||
logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalJdbcScan(id, table, qualifier, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
|
||||
return visitor.visitLogicalJdbcScan(this, context);
|
||||
|
||||
@ -267,6 +267,13 @@ public class LogicalJoin<LEFT_CHILD_TYPE extends Plan, RIGHT_CHILD_TYPE extends
|
||||
Optional.empty(), logicalProperties, left(), right(), joinReorderContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalJoin<>(joinType, hashJoinConjuncts, otherJoinConjuncts, hint, markJoinSlotReference,
|
||||
groupExpression, logicalProperties, children.get(0), children.get(1), joinReorderContext);
|
||||
}
|
||||
|
||||
public LogicalJoin<Plan, Plan> withChildrenNoContext(Plan left, Plan right) {
|
||||
return new LogicalJoin<>(joinType, hashJoinConjuncts, otherJoinConjuncts, hint,
|
||||
markJoinSlotReference, left, right);
|
||||
|
||||
@ -126,6 +126,12 @@ public class LogicalLimit<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TY
|
||||
return new LogicalLimit<>(limit, offset, phase, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalLimit<>(limit, offset, phase, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogicalLimit<Plan> withChildren(List<Plan> children) {
|
||||
Preconditions.checkArgument(children.size() == 1);
|
||||
|
||||
@ -30,6 +30,7 @@ import org.apache.doris.nereids.rules.rewrite.mv.AbstractSelectMaterializedIndex
|
||||
import org.apache.doris.nereids.trees.expressions.Slot;
|
||||
import org.apache.doris.nereids.trees.expressions.SlotReference;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.PreAggStatus;
|
||||
import org.apache.doris.nereids.trees.plans.algebra.CatalogRelation;
|
||||
@ -236,6 +237,15 @@ public class LogicalOlapScan extends LogicalRelation implements CatalogRelation,
|
||||
hints, cacheSlotWithSlotName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalOlapScan(id, (Table) table, qualifier, groupExpression, logicalProperties,
|
||||
selectedPartitionIds, partitionPruned, selectedTabletIds,
|
||||
selectedIndexId, indexSelected, preAggStatus, manuallySpecifiedPartitions,
|
||||
hints, cacheSlotWithSlotName);
|
||||
}
|
||||
|
||||
public LogicalOlapScan withSelectedPartitionIds(List<Long> selectedPartitionIds) {
|
||||
return new LogicalOlapScan(id, (Table) table, qualifier, Optional.empty(), Optional.of(getLogicalProperties()),
|
||||
selectedPartitionIds, true, selectedTabletIds,
|
||||
@ -328,8 +338,8 @@ public class LogicalOlapScan extends LogicalRelation implements CatalogRelation,
|
||||
// when we have a partitioned table without any partition, visible index is empty
|
||||
if (-1 == indexId || olapTable.getVisibleIndexIdToMeta().get(indexId) == null) {
|
||||
return olapTable.getIndexMetaByIndexId(indexId).getSchema()
|
||||
.stream().map(s -> generateUniqueSlot(s, indexId == ((OlapTable) table).getBaseIndexId()))
|
||||
.collect(Collectors.toList());
|
||||
.stream().map(s -> generateUniqueSlot(s, indexId == ((OlapTable) table).getBaseIndexId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return olapTable.getVisibleIndexIdToMeta().get(indexId).getSchema()
|
||||
.stream()
|
||||
@ -340,7 +350,7 @@ public class LogicalOlapScan extends LogicalRelation implements CatalogRelation,
|
||||
private Slot generateUniqueSlot(Column column, boolean isBaseIndex) {
|
||||
String name = isBaseIndex ? column.getName()
|
||||
: AbstractSelectMaterializedIndexRule.parseMvColumnToMvName(column.getName(),
|
||||
column.isAggregated() ? Optional.of(column.getAggregationType().toSql()) : Optional.empty());
|
||||
column.isAggregated() ? Optional.of(column.getAggregationType().toSql()) : Optional.empty());
|
||||
if (cacheSlotWithSlotName.containsKey(name)) {
|
||||
return cacheSlotWithSlotName.get(name);
|
||||
}
|
||||
|
||||
@ -127,6 +127,13 @@ public class LogicalOlapTableSink<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalOlapTableSink<>(database, targetTable, cols, partitionIds, groupExpression,
|
||||
logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return child().getOutput();
|
||||
|
||||
@ -76,7 +76,7 @@ public class LogicalOneRowRelation extends LogicalLeaf implements OneRowRelation
|
||||
|
||||
@Override
|
||||
public Plan withGroupExpression(Optional<GroupExpression> groupExpression) {
|
||||
return new LogicalOneRowRelation(projects, groupExpression, Optional.of(logicalPropertiesSupplier.get()));
|
||||
return new LogicalOneRowRelation(projects, groupExpression, Optional.of(getLogicalProperties()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,6 +84,12 @@ public class LogicalOneRowRelation extends LogicalLeaf implements OneRowRelation
|
||||
return new LogicalOneRowRelation(projects, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalOneRowRelation(projects, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return projects.stream()
|
||||
|
||||
@ -193,4 +193,11 @@ public class LogicalPartitionTopN<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
return new LogicalPartitionTopN<>(function, partitionKeys, orderKeys, hasGlobalLimit, partitionLimit,
|
||||
Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalPartitionTopN<>(function, partitionKeys, orderKeys, hasGlobalLimit, partitionLimit,
|
||||
groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,6 +187,13 @@ public class LogicalProject<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_
|
||||
isDistinct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalProject<>(projects, excepts, canEliminate,
|
||||
groupExpression, logicalProperties, children.get(0), isDistinct);
|
||||
}
|
||||
|
||||
public LogicalProject<Plan> withEliminate(boolean isEliminate) {
|
||||
return new LogicalProject<>(projects, excepts, isEliminate, child(), isDistinct);
|
||||
}
|
||||
|
||||
@ -155,6 +155,13 @@ public class LogicalRepeat<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalRepeat<>(groupingSets, outputExpressions, groupExpression, logicalProperties,
|
||||
children.get(0));
|
||||
}
|
||||
|
||||
public LogicalRepeat<CHILD_TYPE> withGroupSetsAndOutput(List<List<Expression>> groupingSets,
|
||||
List<NamedExpression> outputExpressionList) {
|
||||
return new LogicalRepeat<>(groupingSets, outputExpressionList, child());
|
||||
|
||||
@ -65,6 +65,12 @@ public class LogicalSchemaScan extends LogicalRelation implements Scan {
|
||||
return new LogicalSchemaScan(id, table, qualifier, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalSchemaScan(id, table, qualifier, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
|
||||
@ -97,6 +97,12 @@ public class LogicalSelectHint<CHILD_TYPE extends Plan> extends LogicalUnary<CHI
|
||||
return new LogicalSelectHint<>(hints, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalSelectHint<>(hints, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return child().getOutput();
|
||||
|
||||
@ -136,6 +136,13 @@ public class LogicalSort<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYP
|
||||
return new LogicalSort<>(orderKeys, Optional.empty(), logicalProperties, child(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalSort<>(orderKeys, groupExpression, logicalProperties, children.get(0),
|
||||
normalized);
|
||||
}
|
||||
|
||||
public LogicalSort<Plan> withOrderKeys(List<OrderKey> orderKeys) {
|
||||
return new LogicalSort<>(orderKeys, Optional.empty(),
|
||||
Optional.of(getLogicalProperties()), child(), false);
|
||||
|
||||
@ -65,8 +65,8 @@ public class LogicalSubQueryAlias<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
}
|
||||
|
||||
public LogicalSubQueryAlias(List<String> qualifier, Optional<List<String>> columnAliases,
|
||||
Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, CHILD_TYPE child) {
|
||||
Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, CHILD_TYPE child) {
|
||||
super(PlanType.LOGICAL_SUBQUERY_ALIAS, groupExpression, logicalProperties, child);
|
||||
this.qualifier = ImmutableList.copyOf(Objects.requireNonNull(qualifier, "qualifier is null"));
|
||||
this.columnAliases = columnAliases;
|
||||
@ -117,8 +117,8 @@ public class LogicalSubQueryAlias<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
public String toString() {
|
||||
if (columnAliases.isPresent()) {
|
||||
return Utils.toSqlString("LogicalSubQueryAlias",
|
||||
"qualifier", qualifier,
|
||||
"columnAliases", StringUtils.join(columnAliases.get(), ",")
|
||||
"qualifier", qualifier,
|
||||
"columnAliases", StringUtils.join(columnAliases.get(), ",")
|
||||
);
|
||||
}
|
||||
return Utils.toSqlString("LogicalSubQueryAlias",
|
||||
@ -171,6 +171,13 @@ public class LogicalSubQueryAlias<CHILD_TYPE extends Plan> extends LogicalUnary<
|
||||
logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalSubQueryAlias<>(qualifier, columnAliases, groupExpression, logicalProperties,
|
||||
children.get(0));
|
||||
}
|
||||
|
||||
public CTEId cteId() {
|
||||
return StatementScopeIdGenerator.newCTEId();
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import org.apache.doris.nereids.memo.GroupExpression;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.trees.expressions.functions.table.TableValuedFunction;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.algebra.TVFRelation;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
@ -28,6 +29,7 @@ import org.apache.doris.nereids.util.Utils;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -61,6 +63,12 @@ public class LogicalTVFRelation extends LogicalRelation implements TVFRelation {
|
||||
return new LogicalTVFRelation(id, function, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalTVFRelation(id, function, groupExpression, logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toSqlString("LogicalTVFRelation",
|
||||
|
||||
@ -135,4 +135,10 @@ public class LogicalTopN<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_TYP
|
||||
public LogicalTopN<Plan> withLogicalProperties(Optional<LogicalProperties> logicalProperties) {
|
||||
return new LogicalTopN<>(orderKeys, limit, offset, Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalTopN<>(orderKeys, limit, offset, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,6 +130,13 @@ public class LogicalUnion extends LogicalSetOperation implements Union, OutputPr
|
||||
Optional.empty(), logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalUnion(qualifier, outputs, constantExprsList, hasPushedFilter, groupExpression,
|
||||
logicalProperties, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogicalUnion withNewOutputs(List<NamedExpression> newOutputs) {
|
||||
return new LogicalUnion(qualifier, newOutputs, constantExprsList,
|
||||
|
||||
@ -60,8 +60,8 @@ public class LogicalWindow<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
}
|
||||
|
||||
public LogicalWindow(List<NamedExpression> windowExpressions, boolean isChecked,
|
||||
Optional<GroupExpression> groupExpression, Optional<LogicalProperties> logicalProperties,
|
||||
CHILD_TYPE child) {
|
||||
Optional<GroupExpression> groupExpression, Optional<LogicalProperties> logicalProperties,
|
||||
CHILD_TYPE child) {
|
||||
super(PlanType.LOGICAL_WINDOW, groupExpression, logicalProperties, child);
|
||||
this.windowExpressions = ImmutableList.copyOf(Objects.requireNonNull(windowExpressions, "output expressions"
|
||||
+ "in LogicalWindow cannot be null"));
|
||||
@ -115,19 +115,25 @@ public class LogicalWindow<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
Optional.empty(), logicalProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalWindow<>(windowExpressions, isChecked, groupExpression, logicalProperties, children.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* LogicalWindow need to add child().getOutput() as its outputs, to resolve patterns like the following
|
||||
* after the implementation rule LogicalWindowToPhysicalWindow:
|
||||
*
|
||||
* <p>
|
||||
* origin:
|
||||
* LogicalProject( projects = [row_number as `row_number`, rank as `rank`]
|
||||
* +--LogicalWindow( windowExpressions = [row_number() over(order by c1), rank() over(order by c2)]
|
||||
*
|
||||
* <p>
|
||||
* after(not show PhysicalLogicalQuickSort generated by enforcer):
|
||||
* PhysicalProject( projects = [row_number as `row_number`, rank as `rank`]
|
||||
* +--PhysicalWindow( windowExpressions = [row_number() over(order by c1)])
|
||||
* +--PhysicalWindow( windowExpressions = [rank() over(order by c2)])
|
||||
*
|
||||
* +----PhysicalWindow( windowExpressions = [rank() over(order by c2)])
|
||||
* <p>
|
||||
* if we don't add child().getOutput(), the top-PhysicalProject cannot find rank()
|
||||
*/
|
||||
@Override
|
||||
@ -143,9 +149,9 @@ public class LogicalWindow<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toSqlString("LogicalWindow",
|
||||
"windowExpressions", windowExpressions,
|
||||
"isChecked", isChecked
|
||||
);
|
||||
"windowExpressions", windowExpressions,
|
||||
"isChecked", isChecked
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -158,7 +164,7 @@ public class LogicalWindow<CHILD_TYPE extends Plan> extends LogicalUnary<CHILD_T
|
||||
}
|
||||
LogicalWindow<?> that = (LogicalWindow<?>) o;
|
||||
return Objects.equals(windowExpressions, that.windowExpressions)
|
||||
&& isChecked == that.isChecked;
|
||||
&& isChecked == that.isChecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -122,6 +122,13 @@ public class UsingJoin<LEFT_CHILD_TYPE extends Plan, RIGHT_CHILD_TYPE extends Pl
|
||||
hashJoinConjuncts, groupExpression, logicalProperties, hint, markJoinSlotReference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new UsingJoin(joinType, children.get(0), children.get(1), otherJoinConjuncts,
|
||||
hashJoinConjuncts, groupExpression, logicalProperties, hint, markJoinSlotReference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withChildren(List<Plan> children) {
|
||||
return new UsingJoin(joinType, children.get(0), children.get(1), otherJoinConjuncts,
|
||||
|
||||
@ -121,6 +121,13 @@ public class PhysicalAssertNumRows<CHILD_TYPE extends Plan> extends PhysicalUnar
|
||||
logicalProperties.get(), physicalProperties, statistics, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalAssertNumRows<>(assertNumRowsElement, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalAssertNumRows<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -122,6 +122,13 @@ public class PhysicalCTEAnchor<
|
||||
Optional.empty(), logicalProperties.get(), child(0), child(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalCTEAnchor<>(cteId, groupExpression, logicalProperties.get(), children.get(0),
|
||||
children.get(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCTEAnchor<Plan, Plan> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -160,6 +160,13 @@ public class PhysicalCTEConsumer extends PhysicalRelation {
|
||||
Optional.empty(), logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalCTEConsumer(cteId, consumerToProducerSlotMap, producerToConsumerSlotMap,
|
||||
groupExpression, logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCTEConsumer withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -121,6 +121,12 @@ public class PhysicalCTEProducer<CHILD_TYPE extends Plan> extends PhysicalUnary<
|
||||
return new PhysicalCTEProducer<>(cteId, projects, Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalCTEProducer<>(cteId, projects, groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCTEProducer<CHILD_TYPE> withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -110,6 +110,13 @@ public class PhysicalDistribute<CHILD_TYPE extends Plan> extends PhysicalUnary<C
|
||||
logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalDistribute<>(distributionSpec, groupExpression,
|
||||
logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalDistribute<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -79,6 +79,13 @@ public class PhysicalEmptyRelation extends PhysicalLeaf implements EmptyRelation
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalEmptyRelation(projects, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Slot> computeOutput() {
|
||||
return projects.stream()
|
||||
|
||||
@ -23,6 +23,7 @@ import org.apache.doris.nereids.properties.DistributionSpec;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.properties.PhysicalProperties;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -105,6 +106,12 @@ public class PhysicalEsScan extends PhysicalRelation {
|
||||
return new PhysicalEsScan(id, table, qualifier, distributionSpec, groupExpression, logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalEsScan(id, table, qualifier, distributionSpec, groupExpression, logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExternalTable getTable() {
|
||||
return table;
|
||||
|
||||
@ -84,6 +84,12 @@ public class PhysicalExcept extends PhysicalSetOperation {
|
||||
return new PhysicalExcept(qualifier, Optional.empty(), logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalExcept(qualifier, groupExpression, logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalExcept withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -24,6 +24,7 @@ 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.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -112,6 +113,13 @@ public class PhysicalFileScan extends PhysicalRelation {
|
||||
groupExpression, logicalProperties.get(), conjuncts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalFileScan(id, table, qualifier, distributionSpec,
|
||||
groupExpression, logicalProperties.get(), conjuncts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExternalTable getTable() {
|
||||
return table;
|
||||
|
||||
@ -118,6 +118,12 @@ public class PhysicalFilter<CHILD_TYPE extends Plan> extends PhysicalUnary<CHILD
|
||||
return new PhysicalFilter<>(conjuncts, Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalFilter<>(conjuncts, groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalFilter<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -143,6 +143,13 @@ public class PhysicalGenerate<CHILD_TYPE extends Plan> extends PhysicalUnary<CHI
|
||||
Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalGenerate<>(generators, generatorOutput,
|
||||
groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalGenerate<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -252,6 +252,14 @@ public class PhysicalHashAggregate<CHILD_TYPE extends Plan> extends PhysicalUnar
|
||||
requireProperties, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalHashAggregate<>(groupByExpressions, outputExpressions, partitionExpressions,
|
||||
aggregateParam, maybeUsingStream, groupExpression, logicalProperties.get(),
|
||||
requireProperties, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalHashAggregate<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -182,6 +182,13 @@ public class PhysicalHashJoin<
|
||||
Optional.empty(), logicalProperties.get(), left(), right());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalHashJoin<>(joinType, hashJoinConjuncts, otherJoinConjuncts, hint, markJoinSlotReference,
|
||||
groupExpression, logicalProperties.get(), children.get(0), children.get(1));
|
||||
}
|
||||
|
||||
public PhysicalHashJoin<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
return new PhysicalHashJoin<>(joinType, hashJoinConjuncts, otherJoinConjuncts, hint, markJoinSlotReference,
|
||||
|
||||
@ -84,6 +84,12 @@ public class PhysicalIntersect extends PhysicalSetOperation {
|
||||
return new PhysicalIntersect(qualifier, Optional.empty(), logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalIntersect(qualifier, groupExpression, logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalIntersect withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -23,6 +23,7 @@ import org.apache.doris.nereids.properties.DistributionSpec;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.properties.PhysicalProperties;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
import org.apache.doris.nereids.util.Utils;
|
||||
@ -105,6 +106,12 @@ public class PhysicalJdbcScan extends PhysicalRelation {
|
||||
return new PhysicalJdbcScan(id, table, qualifier, distributionSpec, groupExpression, logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalJdbcScan(id, table, qualifier, distributionSpec, groupExpression, logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableIf getTable() {
|
||||
return table;
|
||||
|
||||
@ -122,6 +122,12 @@ public class PhysicalLimit<CHILD_TYPE extends Plan> extends PhysicalUnary<CHILD_
|
||||
return new PhysicalLimit<>(limit, offset, phase, logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalLimit<>(limit, offset, phase, groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalLimit<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -148,6 +148,14 @@ public class PhysicalNestedLoopJoin<
|
||||
logicalProperties.get(), left(), right());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalNestedLoopJoin<>(joinType,
|
||||
hashJoinConjuncts, otherJoinConjuncts, markJoinSlotReference, groupExpression,
|
||||
logicalProperties.get(), children.get(0), children.get(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalNestedLoopJoin<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -25,6 +25,7 @@ import org.apache.doris.nereids.properties.PhysicalProperties;
|
||||
import org.apache.doris.nereids.trees.expressions.Slot;
|
||||
import org.apache.doris.nereids.trees.plans.AbstractPlan;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.PreAggStatus;
|
||||
import org.apache.doris.nereids.trees.plans.algebra.OlapScan;
|
||||
@ -163,6 +164,14 @@ public class PhysicalOlapScan extends PhysicalRelation implements OlapScan {
|
||||
logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalOlapScan(id, olapTable, qualifier, selectedIndexId, selectedTabletIds,
|
||||
selectedPartitionIds, distributionSpec, preAggStatus, baseOutputs, groupExpression,
|
||||
logicalProperties.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalOlapScan withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -179,6 +179,13 @@ public class PhysicalOlapTableSink<CHILD_TYPE extends Plan> extends PhysicalUnar
|
||||
groupExpression, logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalOlapTableSink<>(database, targetTable, partitionIds, cols, singleReplicaLoad,
|
||||
groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
return new PhysicalOlapTableSink<>(database, targetTable, partitionIds, cols, singleReplicaLoad,
|
||||
|
||||
@ -83,6 +83,13 @@ public class PhysicalOneRowRelation extends PhysicalLeaf implements OneRowRelati
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalOneRowRelation(projects, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.toSqlString("PhysicalOneRowRelation[" + id.asInt() + "]" + getGroupIdAsString(),
|
||||
|
||||
@ -167,6 +167,13 @@ public class PhysicalPartitionTopN<CHILD_TYPE extends Plan> extends PhysicalUnar
|
||||
Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalPartitionTopN<>(function, partitionKeys, orderKeys, hasGlobalLimit, partitionLimit,
|
||||
groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPartitionTopN<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -122,6 +122,12 @@ public class PhysicalProject<CHILD_TYPE extends Plan> extends PhysicalUnary<CHIL
|
||||
return new PhysicalProject<>(projects, Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalProject<>(projects, groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalProject<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -89,6 +89,12 @@ public class PhysicalQuickSort<CHILD_TYPE extends Plan> extends AbstractPhysical
|
||||
return new PhysicalQuickSort<>(orderKeys, phase, Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalQuickSort<>(orderKeys, phase, groupExpression, logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalQuickSort<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -163,6 +163,13 @@ public class PhysicalRepeat<CHILD_TYPE extends Plan> extends PhysicalUnary<CHILD
|
||||
logicalProperties.get(), physicalProperties, statistics, child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalRepeat<>(groupingSets, outputExpressions, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics, children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalRepeat<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -75,6 +75,13 @@ public class PhysicalSchemaScan extends PhysicalRelation implements Scan {
|
||||
physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalSchemaScan(id, table, qualifier, groupExpression, logicalProperties.get(),
|
||||
physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -128,6 +128,13 @@ public class PhysicalStorageLayerAggregate extends PhysicalRelation {
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalStorageLayerAggregate(relation, aggOp, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -23,6 +23,7 @@ import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.properties.PhysicalProperties;
|
||||
import org.apache.doris.nereids.trees.expressions.functions.table.TableValuedFunction;
|
||||
import org.apache.doris.nereids.trees.plans.ObjectId;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.PlanType;
|
||||
import org.apache.doris.nereids.trees.plans.algebra.TVFRelation;
|
||||
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
|
||||
@ -31,6 +32,7 @@ import org.apache.doris.statistics.Statistics;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -65,6 +67,13 @@ public class PhysicalTVFRelation extends PhysicalRelation implements TVFRelation
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalTVFRelation(id, function, groupExpression,
|
||||
logicalProperties.get(), physicalProperties, statistics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -124,6 +124,13 @@ public class PhysicalTopN<CHILD_TYPE extends Plan> extends AbstractPhysicalSort<
|
||||
return new PhysicalTopN<>(orderKeys, limit, offset, phase, Optional.empty(), logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalTopN<>(orderKeys, limit, offset, phase, groupExpression, logicalProperties.get(),
|
||||
children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalTopN<CHILD_TYPE> withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -105,6 +105,12 @@ public class PhysicalUnion extends PhysicalSetOperation implements Union {
|
||||
return new PhysicalUnion(qualifier, constantExprsList, Optional.empty(), logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalUnion(qualifier, constantExprsList, groupExpression, logicalProperties.get(), children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalUnion withPhysicalPropertiesAndStats(
|
||||
PhysicalProperties physicalProperties, Statistics statistics) {
|
||||
|
||||
@ -143,6 +143,13 @@ public class PhysicalWindow<CHILD_TYPE extends Plan> extends PhysicalUnary<CHILD
|
||||
logicalProperties.get(), child());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new PhysicalWindow<>(windowFrameGroup, requireProperties, groupExpression,
|
||||
logicalProperties.get(), children.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statistics) {
|
||||
|
||||
@ -122,5 +122,11 @@ public class RewriteTopDownJobTest {
|
||||
public Plan withLogicalProperties(Optional<LogicalProperties> logicalProperties) {
|
||||
return new LogicalBoundRelation(table, qualifier, Optional.empty(), logicalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return new LogicalBoundRelation(table, qualifier, groupExpression, logicalProperties);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,6 +98,12 @@ public class PlanOutputTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plan withGroupExprLogicalPropChildren(Optional<GroupExpression> groupExpression,
|
||||
Optional<LogicalProperties> logicalProperties, List<Plan> children) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalPlan withPhysicalPropertiesAndStats(PhysicalProperties physicalProperties,
|
||||
Statistics statsDeriveResult) {
|
||||
|
||||
Reference in New Issue
Block a user