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

Haisheng Yuan updated CALCITE-3425:
-----------------------------------
    Description: 
To use customized metadata provider, we can do the following:

{code:java}
RelMetadataQuery.THREAD_PROVIDERS.set(
      JaninoRelMetadataProvider.of(xxxmetadataProvider));
{code}

It only works for builtin metadata type, but for customized metadata, we still 
get exception when retrieve the metadata using reflection. Because when the 
RelOptCluster is created, it always use the default metadata provider, instead 
of the customized one.

{code:java}
setMetadataProvider(DefaultRelMetadataProvider.INSTANCE);
{code}

It causes confusion. We have to set the provider in 2 places. Should we unify 
them in a single place?


  was:
To use customized metadata provider, we can do the following:

{code:java}
RelMetadataQuery.THREAD_PROVIDERS.set(
      JaninoRelMetadataProvider.of(xxxmetadataProvider));
{code}

It only works for builtin metadata type, but for customized metadata, we still 
get exception when retrieve the metadata using reflection. Because when the 
RelOptCluster is created, it always use the default metadata provider, instead 
of the customized one.

{code:java}
setMetadataProvider(DefaultRelMetadataProvider.INSTANCE);
{code}

It causes confusing. We have to set the provider in 2 places. Should we unify 
them in a single place?



> Inconsistent behavior of MetadataProvider in RelOptCluster
> ----------------------------------------------------------
>
>                 Key: CALCITE-3425
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3425
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Haisheng Yuan
>            Priority: Major
>
> To use customized metadata provider, we can do the following:
> {code:java}
> RelMetadataQuery.THREAD_PROVIDERS.set(
>       JaninoRelMetadataProvider.of(xxxmetadataProvider));
> {code}
> It only works for builtin metadata type, but for customized metadata, we 
> still get exception when retrieve the metadata using reflection. Because when 
> the RelOptCluster is created, it always use the default metadata provider, 
> instead of the customized one.
> {code:java}
> setMetadataProvider(DefaultRelMetadataProvider.INSTANCE);
> {code}
> It causes confusion. We have to set the provider in 2 places. Should we unify 
> them in a single place?



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

Reply via email to