Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,14 @@ public PlanOptimizers(
new PushDownDereferencesThroughRowNumber(typeAnalyzer),
new PushDownDereferencesThroughTopNRanking(typeAnalyzer));

Set<Rule<?>> limitPushdownRules = ImmutableSet.of(
new PushLimitThroughOffset(),
new PushLimitThroughProject(typeAnalyzer),
new PushLimitThroughMarkDistinct(),
new PushLimitThroughOuterJoin(),
new PushLimitThroughSemiJoin(),
new PushLimitThroughUnion());

IterativeOptimizer inlineProjections = new IterativeOptimizer(
metadata,
ruleStats,
Expand Down Expand Up @@ -445,6 +453,7 @@ public PlanOptimizers(
ImmutableSet.<Rule<?>>builder()
.addAll(columnPruningRules)
.addAll(projectionPushdownRules)
.addAll(limitPushdownRules)
.addAll(new UnwrapRowSubscript().rules())
.addAll(new PushCastIntoRow().rules())
.addAll(ImmutableSet.of(
Expand All @@ -458,16 +467,10 @@ public PlanOptimizers(
new RemoveFullSample(),
new EvaluateZeroSample(),
new PushOffsetThroughProject(),
new PushLimitThroughOffset(),
new PushLimitThroughProject(typeAnalyzer),
new MergeLimits(),
new MergeLimitWithSort(),
new MergeLimitOverProjectWithSort(),
new MergeLimitWithTopN(),
new PushLimitThroughMarkDistinct(),
new PushLimitThroughOuterJoin(),
new PushLimitThroughSemiJoin(),
new PushLimitThroughUnion(),
new RemoveTrivialFilters(),
new RemoveRedundantLimit(),
new RemoveRedundantOffset(),
Expand Down