[
https://issues.apache.org/jira/browse/PHOENIX-3355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15562997#comment-15562997
]
Maryann Xue commented on PHOENIX-3355:
--------------------------------------
Yes, DDLs have a completely execution path from other statements (queries and
DMLs). DDLs only go through Calcite's parser (not even validation) and then get
translated into Phoenix AST and executed directly in Phoenix, whereas other
statements go through Calcite's parser, validator, query planner, and then be
translated into Phoenix QueryPlans, which is also when functions and other
expressions are translated into Phoenix classes. So you could imagine, for a
built-in function in DDL, e.g. TO_DATE(), it will be parsed by Calcite parser,
but will not be validated by Calcite, which means it doesn't matter whether
Calcite knows of this function signature. And even afterwards when it comes to
the execution of the CREATE VIEW statement in Phoenix, the TO_DATE() function
will only exist in its ParseNode form and won't be executed anyway.
However I don't believe we can get away with it when we try to reference this
VIEW in a query, coz that's when Calcite will try converting the view
definition into a Rel.
Another thing is that if you look at CalciteUtils' translation of other
functions, there are a few built-in functions like SQRT, ABS, etc, that are
support by both Calcite and Phoenix, and we simply translate them the same way
as we do for other expressions. But in case we have functions with a different
signature than Calcite, the UDF approach would work instead.
> 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
>
> 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)