[ 
https://issues.apache.org/jira/browse/DRILL-4576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16886808#comment-16886808
 ] 

ASF GitHub Bot commented on DRILL-4576:
---------------------------------------

vvysotskyi commented on pull request #484: DRILL-4576: Add PlannerCallback 
interface for additional planner initialization.
URL: https://github.com/apache/drill/pull/484#discussion_r304288475
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/SqlHandlerConfig.java
 ##########
 @@ -45,11 +49,28 @@ public QueryContext getContext() {
   }
 
   public RuleSet getRules(PlannerPhase phase) {
+    return phase.getRules(context, getPlugins());
+  }
+
+  public PlannerCallback getPlannerCallback(PlannerPhase phase){
+    List<PlannerCallback> callbacks = Lists.newArrayList();
+    for(StoragePlugin plugin: getPlugins()){
+      if(plugin instanceof AbstractStoragePlugin){
+        PlannerCallback callback = 
((AbstractStoragePlugin)plugin).getPlannerCallback(context, phase);
 
 Review comment:
   Can we add `getPlannerCallback()` method to `StoragePlugin` interface, so 
there is no cast would be required?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


> Add StoragePlugin API to register materialization into planner
> --------------------------------------------------------------
>
>                 Key: DRILL-4576
>                 URL: https://issues.apache.org/jira/browse/DRILL-4576
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Laurent Goujon
>            Priority: Major
>
> There's no currently a good way to register materializations into Drill 
> planner. Calcite's MaterializationService.instance() would be the way to go, 
> but the registration happens in 
> {{org.apache.calcite.prepare.Prepare.PreparedResult#prepareSql()}}, which is 
> not called by Drill.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to