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

Rajeshbabu Chintaguntla commented on PHOENIX-3355:
--------------------------------------------------

[~maryannxue]
This is the test case running for checking default values in function
{noformat}
UserDefinedFunctionsIT#testVerifyCreateFunctionArguments() 
{noformat}
Here is the plan difference with and without default values in the function. 
While running query optimizing logic not touching PhoenixServerProject 
{noformat}
EnumerableCalc(expr#0..2=[{inputs}], expr#3=[DEFAULT()], expr#4=[MYSUM($t0, 
$t3)], EXPR$0=[$t4]): rowcount = 1115506.0, cumulative cost = {1117081.095022 
rows, 6694611.095022 cpu, 0.0 io}, id = 153
  PhoenixToEnumerableConverter: rowcount = 1115506.0, cumulative cost = 
{1575.0950220000002 rows, 1575.0950220000002 cpu, 0.0 io}, id = 149
    PhoenixTableScan(table=[[phoenix, T4]]): rowcount = 1115506.0, cumulative 
cost = {1572.8640100000002 rows, 1572.8640100000002 cpu, 0.0 io}, id = 104
{noformat}
{noformat}
PhoenixToEnumerableConverter: rowcount = 1115506.0, cumulative cost = 
{1575.0950619999644 rows, 1575.0950220000002 cpu, 0.0 io}, id = 102
  PhoenixServerProject(EXPR$0=[MYSUM($0, 12)]): rowcount = 1115506.0, 
cumulative cost = {1572.8640499999644 rows, 1572.8640100000002 cpu, 0.0 io}, id 
= 100
    PhoenixTableScan(table=[[phoenix, T4]]): rowcount = 1115506.0, cumulative 
cost = {1572.8640100000002 rows, 1572.8640100000002 cpu, 0.0 io}, id = 31
{noformat}
Can you take a look at this why is this happening and how to handle it?

For handling built in functions instead of going by registering them as UDFs or 
converting BuiltInFunctionInfo to PFunction better to construct 
PhoenixScalarFunction from BuiltInFunctionInfo which already have function 
constructor and parse node constructor and also for aggregate functions we need 
to have PhoenixAggregateFunction class similar to this.

> 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)

Reply via email to