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-538) Support UDFs
Date Fri, 24 Apr 2015 23:08:38 GMT


ASF GitHub Bot commented on PHOENIX-538:

GitHub user chrajeshbabu opened a pull request:

    PHOENIX-538 Support UDFs

    Patch to support UDFs. It mainly includes
    - create temporary/permanent function query parsing
    - storing function info
    - dynamically loading udf jars.
    - resolve functions 
    - making use of udfs in different queries
    - drop function.
    - it tests

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #77
commit a0c62d52492167b0d7c3d7b2036de8acfb762d92
Author: Rajeshbabu Chintaguntla <>
Date:   2015-04-24T23:03:55Z

    PHOENIX-538 Support UDFs


> Support UDFs
> ------------
>                 Key: PHOENIX-538
>                 URL:
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Rajeshbabu Chintaguntla
>             Fix For: 5.0.0, 4.4.0
>         Attachments: PHOENIX-538-wip.patch, PHOENIX-538_v1.patch, PHOENIX-538_v2.patch,
PHOENIX-538_v3.patch, PHOENIX-538_v4.patch, PHOENIX-538_v5.patch, PHOENIX-538_v6.patch
> Phoenix allows built-in functions to be added (as described [here](
with the restriction that they must be in the phoenix jar. We should improve on this and allow
folks to declare new functions through a CREATE FUNCTION command like this:
>       CREATE FUNCTION mdHash(anytype)
>       RETURNS binary(16)
>       LOCATION 'hdfs://path-to-my-jar' ''
> Since HBase supports loading jars dynamically, this would not be too difficult. The function
implementation class would be required to extend our ScalarFunction base class. Here's how
I could see it being implemented:
> * modify the phoenix grammar to support the new CREATE FUNCTION syntax
> * create a new UTFParseNode class to capture the parse state
> * add a new method to the MetaDataProtocol interface
> * add a new method in ConnectionQueryServices to invoke the MetaDataProtocol method
> * add a new method in MetaDataClient to invoke the ConnectionQueryServices method
> * persist functions in a new "SYSTEM.FUNCTION" table
> * add a new client-side representation to cache functions called PFunction
> * modify ColumnResolver to dynamically resolve a function in the same way we dynamically
resolve and load a table
> * create and register a new ExpressionType called UDFExpression
> * at parse time, check for the function name in the built in list first (as is currently
done), and if not found in the PFunction cache. If not found there, then use the new UDFExpression
as a placeholder and have the ColumnResolver attempt to resolve it at compile time and throw
an error if unsuccessful.

This message was sent by Atlassian JIRA

View raw message