[ 
https://issues.apache.org/jira/browse/CALCITE-1057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maryann Xue updated CALCITE-1057:
---------------------------------
    Attachment: CALCITE-1057.patch

Could you please take a look at this one, [~julianhyde]? Not sure if I should 
even remove or deprecate CALC_PROGRAM and SUBQUERY_PROGRAM as they are not used 
anywhere within Calcite after this change.

> Provide an interface to allow for a custom RelMetadataProvider in getting the 
> standard Program
> ----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1057
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1057
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>            Priority: Minor
>         Attachments: CALCITE-1057.patch
>
>
> The Programs class has a static method standard() used by the default Calcite 
> driver. So far Calcite-Phoenix is using the same sql prepare logic with some 
> slight customization, like plugging in a set of its own rules. The static 
> standard(), though, does not work properly for Phoenix since some 
> sub-programs it returns are initiated with the default RelMetadataProvider 
> while Phoenix needs to plug-in its own, otherwise it just could not work.
> {code}
>   /** Program that converts filters and projects to {@link Calc}s. */
>   public static final Program CALC_PROGRAM =
>       hep(CALC_RULES, true, new DefaultRelMetadataProvider());
>   /** Program that expands sub-queries. */
>   public static final Program SUB_QUERY_PROGRAM =
>       hep(
>           ImmutableList.of((RelOptRule) SubQueryRemoveRule.FILTER,
>               SubQueryRemoveRule.PROJECT,
>               SubQueryRemoveRule.JOIN), true, new 
> DefaultRelMetadataProvider());
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to