Skip to content

Commit de82989

Browse files
committed
feat: add Hooks.AFTER_OPTIMIZATION
1 parent c920d24 commit de82989

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ VERSION=1.39.0
3131

3232
for module in linq4j core;
3333
do
34-
./gradlew :${module}:clean :${module}:publishToMavenLocal
34+
./gradlew :${module}:clean -x :core:javadoc :${module}:publishToMavenLocal
3535
mvn install:install-file \
3636
-Dfile=${module}/build/libs/calcite-${module}-$VERSION-SNAPSHOT.jar \
3737
-DgroupId=org.apache.calcite \

core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191

9292
import static java.util.Objects.requireNonNull;
9393

94+
import static org.apache.calcite.runtime.Hook.AFTER_OPTIMIZATION;
95+
9496
/**
9597
* VolcanoPlanner optimizes queries by transforming expressions selectively
9698
* according to a dynamic programming algorithm.
@@ -533,6 +535,7 @@ protected void registerMaterializations() {
533535
LOGGER.info(sw.toString());
534536
}
535537
dumpRuleAttemptsInfo();
538+
AFTER_OPTIMIZATION.run(root);
536539
RelNode cheapest = root.buildCheapestPlan(this);
537540
if (LOGGER.isDebugEnabled()) {
538541
LOGGER.debug(

core/src/main/java/org/apache/calcite/runtime/Hook.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public enum Hook {
8888
/** Called to create a Program to optimize the statement. */
8989
PROGRAM,
9090

91+
/** Called to create a Program to optimize the statement. */
92+
AFTER_OPTIMIZATION,
93+
9194
/** Called when materialization is created. */
9295
CREATE_MATERIALIZATION,
9396

0 commit comments

Comments
 (0)