[
https://issues.apache.org/jira/browse/PHOENIX-3355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15603529#comment-15603529
]
Maryann Xue commented on PHOENIX-3355:
--------------------------------------
For 2, the ultimate goal is to create a map of PhoenixScalarFunction, and if
PFunction is not enough to describe the information you need, feel free to add
more arguments to PhoenixScalarFunction. So suppose you have a way of iterating
through the built-in function map and find out some function's "base" signature
should be: FuncTest(VARCHAR var1, VARCHAR var2 (default = null), DATE date
(default = TODAY())), you can create a PhoenixScalarFunction that marks the
second and third parameters as optional. And since this map's initialization
will only be done once, either in the constructor or in static initialization,
I wouldn't be worried about the efficiency that much. Looks to me like getting
information from BUILT_IN_FUNCTION_MAP is a cleaner way. And if you do want to
optimize it, you can have a temporary map as you iterate along the built-in
function map.
For 3, I'm not very clear either. Is there a definite return type for each
signature? If yes, I believe we should have different PhoenixScalarFunction to
represent different signatures in this case, contrary to what we do for default
parameters. Does the type derivation have to be done at runtime? Is there an
example?
> 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.wip
>
>
> 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)