[ https://issues.apache.org/jira/browse/CALCITE-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16822783#comment-16822783 ]
Julian Hyde commented on CALCITE-3008: -------------------------------------- I don't really like the idea of a static {{AuxiliaryConverter}} that can handle all functions. It would be monolithic - it would be difficult to add a user-defined function and the ability to convert it. So how about adding the following to {{SqlOperator}}: {code} <T> T unwrap(Class<T> clazz); {code} Then you would call {{function.unwrap(AuxiliaryConverter.class)}} on each function. Thus each function knows how to convert itself. Compare with {{RexSqlConvertlet}}, where there is also one instance for each function. All of the convertlets are registered in a {{RexSqlConvertletTable}}. Following that idea, maybe instead of {{unwrap}} we could add a method {{SqlFunction getAuxiliaryConverter(SqlFunction)}} to {{SqlOperatorTable}}. At least we have a way to chain operator tables together, which would make it possible to add UDFs without having to recompile Calcite. > Making AuxiliaryConverter Pluggable > ----------------------------------- > > Key: CALCITE-3008 > URL: https://issues.apache.org/jira/browse/CALCITE-3008 > Project: Calcite > Issue Type: Improvement > Components: core > Reporter: Rong Rong > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Currently the {{AuxiliaryConverter}} in calcite core is set to be static with > only one basic implementation. It would be nice to have it pluggable so that > other systems can implement its own. > Was wondering if this would be a good feature to add? -- This message was sent by Atlassian JIRA (v7.6.3#76005)