rkondakov commented on a change in pull request #2024:
URL: https://github.com/apache/calcite/pull/2024#discussion_r439816424



##########
File path: core/src/main/java/org/apache/calcite/plan/RelOptRules.java
##########
@@ -179,11 +179,9 @@ private RelOptRules() {
       SortRemoveRule.INSTANCE);
 
   static final List<RelOptRule> CONSTANT_REDUCTION_RULES = ImmutableList.of(
-      ReduceExpressionsRule.PROJECT_INSTANCE,
-      ReduceExpressionsRule.FILTER_INSTANCE,
-      ReduceExpressionsRule.CALC_INSTANCE,
-      ReduceExpressionsRule.WINDOW_INSTANCE,
-      ReduceExpressionsRule.JOIN_INSTANCE,
+      ReduceExpressionsRule.PROJECT_INSTANCE.get(),
+      ReduceExpressionsRule.FILTER_INSTANCE.get(), 
ReduceExpressionsRule.CALC_INSTANCE.get(),

Review comment:
       Formatting. 

##########
File path: core/src/main/java/org/apache/calcite/plan/RelOptRules.java
##########
@@ -157,18 +157,18 @@ private RelOptRules() {
       UnionMergeRule.INSTANCE,
       UnionMergeRule.INTERSECT_INSTANCE,
       UnionMergeRule.MINUS_INSTANCE,
-      ProjectToWindowRule.PROJECT,
+      ProjectToWindowRule.ProjectToLogicalProjectAndWindowRule.INSTANCE,
       FilterMergeRule.INSTANCE,
       DateRangeRules.FILTER_INSTANCE,
       IntersectToDistinctRule.INSTANCE);
 
   static final List<RelOptRule> ABSTRACT_RELATIONAL_RULES = ImmutableList.of(
-      FilterJoinRule.FILTER_ON_JOIN,
-      FilterJoinRule.JOIN,
+      FilterJoinRule.FILTER_ON_JOIN.get(),
+      FilterJoinRule.JOIN.get(),

Review comment:
       I am not sure that using suppliers is the most elegant way to get rid of 
deadlocks on class loading. As I understand the deadlock mechanics right, It is 
something extremely rare. What if we just deprecate using static fields 
   ```
   FilterJoinRule.FILTER_ON_JOIN,
   FilterJoinRule.JOIN
   ```
   and force using static constants declared within the actual class (not a 
super class, i.e. FilterJoinRule) : 
   ```
   FilterIntoJoinRule.INSTANCE,
   JoinConditionPushRule.INSTANCE
   ```
   What do you think?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to