yanlin-Lynn commented on a change in pull request #1504: [CALCITE-3409] Add an 
interface in MaterializedViewSubstitutionVisito…
URL: https://github.com/apache/calcite/pull/1504#discussion_r334441876
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/plan/MaterializedViewSubstitutionVisitor.java
 ##########
 @@ -54,6 +55,15 @@ public MaterializedViewSubstitutionVisitor(RelNode target_, 
RelNode query_,
     super(target_, query_, EXTENDED_RULES, relBuilderFactory);
   }
 
+  /**
+   * A method used to add a user defined {@link SubstitutionVisitor.UnifyRule},
+   * thus to extend the ability of substitution based materialization
+   * matching in different scenarios.
+   */
+  public static void addMatchingRule(UnifyRule rule) {
+    EXTENDED_RULES.add(rule);
+  }
+
 
 Review comment:
   Some suggestions:
   1. How about add an instance method instead of static class method, and keep 
`EXTENDED_RULES` immutable as it is?
   So that, different instances of MaterializedViewSubstitutionVisitor will not 
affect each other.
   2. If we have `addMatchingRule` method, do we need to have a 
coresponding`removeMatchingRule` method?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to