[
https://issues.apache.org/jira/browse/PHOENIX-3242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15534432#comment-15534432
]
Maryann Xue commented on PHOENIX-3242:
--------------------------------------
Thank you, [~rajeshbabu], for the WIP patch! I have a quick conclusion here:
As [~julianhyde] mentioned this morning, making UDF work takes two stages: sql
validation and runtime method call. I tried running the test case you pointed
out and found that it could not even go through the first stage, validation.
And the reason was that you re-used ScalarFunctionImpl from Calcite and passed
"evaluate()" as the method while its signature was not matchable for
"myfunction(varchar)" at all. The most straight-forward solution is to have our
own implementation class for Function and give it whatever information we'll
need at runtime, including tenant id, JAR path, UDF class name, etc. Then in
CalciteUtils, when translating SqlKind.OTHER_FUNCTION, for
{{SqlUserDefinedFunction}} SqlOperator, you'll unwrap our own implementation
class and create a corresponding Phoenix UDFExpression.
> Support CREATE OR REPLACE FUNCTION in Phoenix-Calcite Integration
> -----------------------------------------------------------------
>
> Key: PHOENIX-3242
> URL: https://issues.apache.org/jira/browse/PHOENIX-3242
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Labels: calcite
> Attachments: PHOENIX-3242-wip.patch, PHOENIX-3242_select-wip.patch,
> PHOENIX-3242_v1.patch, PHOENIX-3242_v2.patch, PHOENIX-3242_v3.patch,
> PHOENIX-3242_v4.patch, PHOENIX-3242_v5.patch, PHOENIX-3242_v6.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)