phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-3355) Register Phoenix built-in functions as Calcite functions
Date Fri, 11 Nov 2016 00:18:58 GMT


ASF GitHub Bot commented on PHOENIX-3355:

Github user maryannxue commented on a diff in the pull request:
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/calcite/
    @@ -90,6 +153,10 @@ public PFunction getFunctionInfo() {
             return functionInfo;
    +    public FunctionParseNode.BuiltInFunctionInfo getParseInfo(){
    --- End diff --
    So here maybe all we need is the exact FunctionExpression class. In case of abstract function
class, we need some additional information in BuiltinFunctionInfo. So I'm thinking to add
annotation for those derived function expression classes, e.g. RoundDateFunction as well.
And in order to let the standalone Phoenix function map not to add the derived signatures
and meanwhile to make sure that calcite-phoenix's function map will not have the abstract
 function classes, we can add one more attribute to BuiltinFunction as:
        @interface Argument {
            Class<? extends PDataType>[] allowedTypes() default {};
            boolean isConstant() default false;
            String defaultValue() default "";
            String enumeration() default "";
            String minValue() default "";
            String maxValue() default "";
            FunctionClassType classType() default FunctionClassType.NONE;
        public enum FunctionClassType {
    Thus in CalciteUtils, we'll use reflection to get the function constructor, either with
or without StatementContext, depending on each individual function, and instantiate the instance.

> Register Phoenix built-in functions as Calcite functions
> --------------------------------------------------------
>                 Key: PHOENIX-3355
>                 URL:
>             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

View raw message