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

Jesus Camacho Rodriguez commented on CALCITE-3409:
--------------------------------------------------

[~xzh_dz], following up on [~zabetak]'s feedback above. Until now, we had not 
exposed the {{UnifyRules}} in the planner and they were rather restricted to 
the {{SubstitutionVisitor}}. It seems you do not need them to be in the planner 
either, instead it would be sufficient for you to have a 
{{SubstitutionVisitor}} that is extensible. Maybe we could limit this patch to 
the changes in the visitor, and avoid changing the {{RelOptPlanner}} APIs for 
the time being. If it turns out that extensibility from the planner is needed, 
we can revisit the idea later on. Thoughts?

> Add an interface in MaterializedViewSubstitutionVisitor to allow registering 
> UnifyRule
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3409
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3409
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Jin Xing
>            Assignee: Jin Xing
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 6h 10m
>  Remaining Estimate: 0h
>
> In current code of MaterializedViewSubstitutionVisitor, all matching rules 
> are internal defined. The existing rules support the most popular scenarios. 
> But my customers sometimes ask for the ability to self define some matching 
> rules, thus to support some special scenarios.
> I take below example as an illustration:
> {code:java}
> Query:
> select * from table
> where from_unixtime(_EVENT_TIME_, "yyyymmdd hh") >= "20190909 00"
> and from_unixtime(_EVENT_TIME_, "yyyymmdd hh") <= "20190909 23" ;
> Materialized View:
> select * from table 
> where from_unixtime(_EVENT_TIME_, "yyyymmdd") = "20190909";{code}
> It's hard to enumerate the matching pattern for different functions in 
> internal matching rules. We can expose a method to register new UnifyRules 
> and allow user to extend the ability of MV matching



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to