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

Maryann Xue commented on PHOENIX-3355:
--------------------------------------

[~jamestaylor], thank you very much for the pointer! Actually after checking 
other function constructors, I realized that the default value approach would 
not be able to cover all cases. Some function node create() methods use the 
{{StatementContext}} object to create a delegate function, and some of them 
even need to get access to ExpressionManager to avoid creating multiple 
versions of the same aggregate function within a single query (for which 
although I believe Calcite has already done common subexpression elimination). 
Anyway, think we should go ahead with either:
1. Constructor with StatementContext. We can use reflection and an if-else to 
create instances, so that we don't need to change constructors for those 
functions that do not need StatementContext.
2. Use factories to create Function instances.

> Register Phoenix built-in functions as Calcite functions
> --------------------------------------------------------
>
>                 Key: PHOENIX-3355
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3355
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Eric Lomore
>              Labels: calcite
>         Attachments: PHOENIX-3355.function_constructor.patch, 
> PHOENIX-3355.wip, PHOENIX-3355.wip2
>
>
> We should register all Phoenix built-in functions that don't exist in Calcite.



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

Reply via email to