[ https://issues.apache.org/jira/browse/CALCITE-2670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692507#comment-16692507 ]
Julian Hyde commented on CALCITE-2670: -------------------------------------- There's no *existing* mechanism. But maybe you could extend the mechanism for generating aggregate functions where the context contains a partially-evaluated aggregate function? (I.e. one for which some of the parameters have been specified.) You could create your own instance of SqlAggregateFunction just for the duration of the code-generation. (Sorry, this may be way off; I don't have time to look at the code. But I do feel we shouldn't be bound by the limitations of the current mechanism.) > Combine similar JSON aggregate functions in operator table > ---------------------------------------------------------- > > Key: CALCITE-2670 > URL: https://issues.apache.org/jira/browse/CALCITE-2670 > Project: Calcite > Issue Type: Improvement > Components: core > Reporter: Hongze Zhang > Assignee: Julian Hyde > Priority: Major > > In current code master of Calcite, operator *JSON_ARRAYAGG* and > *JSON_OBJECTAGG* are separated to *JSON_ARRAYAGG_NULL_ON_NULL*, > *JSON_ARRAYAGG_ABSENT_ON_NULL*, *JSON_OBJECTAGG_NULL_ON_NULL* and > *JSON_OBJECTAGG_ABSENT_ON_NULL* in SqlStdOperatorTable.java. This is OK for > now, but may deliver more difficulty on extending syntax of *JSON_ARRAYAGG* > and *JSON_OBJECTAGG* and on implementing logical plan by adapters. > This is basically to combine the 4 operators to 2, this is a improvement list: > # Combine *JSON_ARRAYAGG_NULL_ON_NULL* and *JSON_ARRAYAGG_ABSENT_ON_NULL;* > # Combine *JSON_OBJECTAGG_NULL_ON_NULL* and *JSON_OBJECTAGG_ABSENT_ON_NULL;* > # *SYMBOL* type Support for *JavaTypeFactoryImpl#getJavaClass* > This is to generate *Enum* java type for *SYMBOL*. Current version of > Calcite generates *Object[]*, which delivers type casting error, or some > method compatible problems {color:#333333}when Calcite tries to pass enum > parameters to an aggregate function;{color} > # Add SQL-to-Rel test cases for JSON functions. -- This message was sent by Atlassian JIRA (v7.6.3#76005)