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

Julian Hyde commented on CALCITE-5844:
--------------------------------------

You don't need to subclass {{{}RelMdColumnOrigins{}}}. Just define your own 
class with methods that have the right signature, and add it to the list of 
providers. The methods should be called by reflection.

> Make RelMdColumnOrigins to be extendable for getting columnOrigins from 
> viewTable
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-5844
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5844
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: JingDas
>            Priority: Minor
>
> In our scene, Getting field from view is expected when call 
> RelMdColumnOrigins#getColumnOrigins.
> So I want to define customized RelMdColumnOrigins extend *RelMdColumnOrigins* 
> which can *getColumnOrigins* from viewTable.
> Then I add customized RelMdColumnOrigins to {*}ChainedRelMetadataProvider{*}, 
> keep the sequence before DefaultRelMetadataProvider.INSTANCE.
> After doing all above, I can get columnOrigins from viewTable.
>  
> But I found the private modifier constructor in class RelMdColumnOrigins(also 
> such as
> RelMdCollation, RelMdColumnUniqueness, RelMdDistribution, 
> RelMdExplainVisibility,
> RelMdPercentageOriginalRows, RelMdPopulationSize, RelMdUniqueKeys
> ),
> and protected modifier constructors(such as RelMdDistinctRowCount, 
> RelMdExpressionLineage, RelMdLowerBoundCost,
> RelMdMemory, RelMdParallelism, RelMdSelectivity, RelMdSize, 
> RelMdTableReferences
> ) 
> and public modifier constructors(such as RelMdAllPredicates, 
> RelMdMaxRowCount, RelMdMinRowCount, RelMdNodeTypes,
> RelMdPredicates, RelMdRowCount, 
> ) 
> I haven't had a chance to extend this class to add my custom logic because 
> the constructor modifier is private.
> These "RelMd"prefixed class are default implementation,  They should can be 
> extended for user to add
> customed logic.
> For extensibility, I think this modifier maybe protected for these 
> "RelMd"prefixed class whose modifier is private.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to