You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "xzh_dz (Jira)" <ji...@apache.org> on 2020/09/22 12:10:00 UTC

[jira] [Comment Edited] (CALCITE-3409) Add an interface in MaterializedViewSubstitutionVisitor to allow registering UnifyRule

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

xzh_dz edited comment on CALCITE-3409 at 9/22/20, 12:09 PM:
------------------------------------------------------------

[~julianhyde] 

Thanks, In my project, we call `org.apache.calcite.plan.RelOptMaterializations#useMaterializedViews` directly to register the external materialized recognition rules.Do you mean we should have a special class to encapsulate the external materialization rules?


was (Author: xzh_dz):
[~julianhyde] 

Thanks, Do you mean we should have a special class to encapsulate the external materialization rules?

> 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: 4h 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)