Skip to content

Commit 874b89c

Browse files
authored
misc: Run remote function optimizer after logical connector optimizer (#26642)
## Description We have a connector optimizer which adds remote functions, hence need to rerun the remote function related optimizer after the logical connector optimizer. ## Motivation and Context In description ## Impact In description ## Test Plan Easy change ## Contributor checklist - [ ] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [ ] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. - [ ] If adding new dependencies, verified they have an [OpenSSF Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or higher (or obtained explicit TSC approval for lower scores). ## Release Notes Please follow [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines) and fill in the release notes below. ``` == NO RELEASE NOTE == ```
1 parent 709047e commit 874b89c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

presto-main-base/src/main/java/com/facebook/presto/sql/planner/PlanOptimizers.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,14 @@ public PlanOptimizers(
764764
// Pass a supplier so that we pickup connector optimizers that are installed later
765765
builder.add(
766766
new ApplyConnectorOptimization(() -> planOptimizerManager.getOptimizers(LOGICAL)),
767+
new IterativeOptimizer(
768+
metadata,
769+
ruleStats,
770+
statsCalculator,
771+
costCalculator,
772+
ImmutableSet.of(
773+
new RewriteFilterWithExternalFunctionToProject(metadata.getFunctionAndTypeManager()),
774+
new PlanRemoteProjections(metadata.getFunctionAndTypeManager()))),
767775
projectionPushDown,
768776
new PruneUnreferencedOutputs());
769777

0 commit comments

Comments
 (0)