File tree 2 files changed +9
-2
lines changed
presto-main-base/src/main/java/com/facebook/presto/sql/planner 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -733,6 +733,14 @@ public PlanOptimizers(
733
733
builder .add (new SimplifyPlanWithEmptyInput (),
734
734
new PruneUnreferencedOutputs ());
735
735
736
+ // Run columnPruningRules one more time to optimize the ProjectNode generated in SimplifyPlanWithEmptyInput.
737
+ builder .add (new IterativeOptimizer (
738
+ metadata ,
739
+ ruleStats ,
740
+ statsCalculator ,
741
+ estimatedExchangesCostCalculator ,
742
+ columnPruningRules ));
743
+
736
744
builder .add (new IterativeOptimizer (
737
745
metadata ,
738
746
ruleStats ,
@@ -886,6 +894,7 @@ public PlanOptimizers(
886
894
// Run RemoveEmptyDelete and EliminateEmptyJoins after table scan is removed by PickTableLayout/AddExchanges
887
895
ImmutableSet .of (new RemoveEmptyDelete ())));
888
896
builder .add (predicatePushDown ); // Run predicate push down one more time in case we can leverage new information from layouts' effective predicate
897
+ builder .add (new WindowFilterPushDown (metadata ));
889
898
builder .add (new RemoveUnsupportedDynamicFilters (metadata .getFunctionAndTypeManager ()));
890
899
builder .add (simplifyRowExpressionOptimizer ); // Should be always run after PredicatePushDown
891
900
builder .add (projectionPushDown );
Original file line number Diff line number Diff line change 51
51
import static com .facebook .presto .common .type .BigintType .BIGINT ;
52
52
import static com .facebook .presto .expressions .LogicalRowExpressions .TRUE_CONSTANT ;
53
53
import static com .facebook .presto .sql .planner .plan .ChildReplacer .replaceChildren ;
54
- import static com .google .common .base .Preconditions .checkState ;
55
54
import static com .google .common .base .Verify .verify ;
56
55
import static com .google .common .collect .Iterables .getOnlyElement ;
57
56
import static java .lang .Math .toIntExact ;
@@ -116,7 +115,6 @@ public boolean isPlanChanged()
116
115
@ Override
117
116
public PlanNode visitWindow (WindowNode node , RewriteContext <Void > context )
118
117
{
119
- checkState (node .getWindowFunctions ().size () == 1 , "WindowFilterPushdown requires that WindowNodes contain exactly one window function" );
120
118
PlanNode rewrittenSource = context .rewrite (node .getSource ());
121
119
122
120
if (canReplaceWithRowNumber (node , metadata .getFunctionAndTypeManager ())) {
You can’t perform that action at this time.
0 commit comments