Skip to content

Commit

Permalink
fix by comment
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Dec 16, 2022
1 parent 70bda01 commit d2b5625
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,6 @@ public ArrayList<FunctionCallExpr> getMaterializedAggregateExprs() {
return result;
}

public List<String> getMaterializedAggregateExprLabels() {
return Lists.newArrayList(materializedSlotLabels);
}

public AggregateInfo getMergeAggInfo() {
return mergeAggInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public TupleId getOutputTupleId() {
return outputTupleDesc.getId();
}

public List<String> getMaterializedAggregateExprLabels() {
return Lists.newArrayList(materializedSlotLabels);
}

public boolean requiresIntermediateTuple() {
Preconditions.checkNotNull(intermediateTupleDesc);
Preconditions.checkNotNull(outputTupleDesc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public NereidsRewriteJobExecutor(CascadesContext cascadesContext) {
.add(topDownBatch(ImmutableList.of(new ColumnPruning())))
.add(topDownBatch(RuleSet.PUSH_DOWN_FILTERS, false))
.add(visitorJob(RuleType.INFER_PREDICATES, new InferPredicates()))
.add(topDownBatch(RuleSet.PUSH_DOWN_FILTERS, false))
.add(visitorJob(RuleType.INFER_PREDICATES, new InferPredicates()))
.add(topDownBatch(RuleSet.PUSH_DOWN_FILTERS, false))
.add(topDownBatch(ImmutableList.of(PushFilterInsideJoin.INSTANCE)))
.add(topDownBatch(ImmutableList.of(new FindHashConditionForJoin())))
.add(topDownBatch(ImmutableList.of(new LimitPushDown())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void execute() {
pushJob(new DeriveStatsJob(groupExpression, true, context));

List<Group> children = groupExpression.children();
// rule maybe return new logical plans to wrap some new physical plans,
// so we should check derive stats for it if no stats
for (int i = children.size() - 1; i >= 0; i--) {
Group childGroup = children.get(i);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public PhysicalProperties visitPhysicalNestedLoopJoin(

@Override
public PhysicalProperties visitPhysicalOlapScan(PhysicalOlapScan olapScan, PlanContext context) {
// TODO: find a better way to handle both tablet num == 1 and colocate table together in future
if (!olapScan.getTable().isColocateTable() && olapScan.getScanTabletNum() == 1) {
return PhysicalProperties.GATHER;
} else if (olapScan.getDistributionSpec() instanceof DistributionSpecHash) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,14 @@ public Set<NamedExpression> pushDownToNamedExpression(Collection<? extends Expre

/** NormalizeToSlotTriplet */
class NormalizeToSlotTriplet {
// which expression need to normalized to slot?
// e.g. `a + 1`
public final Expression originExpr;
// the slot already normalized.
// e.g. new Alias(`a + 1`).toSlot()
public final Slot remainExpr;
// the output expression need to push down to the bottom project.
// e.g. new Alias(`a + 1`)
public final NamedExpression pushedExpr;

public NormalizeToSlotTriplet(Expression originExpr, Slot remainExpr, NamedExpression pushedExpr) {
Expand Down

0 comments on commit d2b5625

Please sign in to comment.