You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Shuyi Chen (JIRA)" <ji...@apache.org> on 2018/01/31 01:47:00 UTC

[jira] [Commented] (CALCITE-2046) Support "CREATE FUNCTION" DDL

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

Shuyi Chen commented on CALCITE-2046:
-------------------------------------

Hi, [~julianhyde]

Yes, I planned to use class-loader to load the jars. To find the UDFs, I changed the grammar below to get full path of class that implements the function in the provided jars. Also we can define a common abstract class in Calcite, e.g. ScalarFunction, AggregationFunction, and TableFunction, and we can verify that the class provided extends one of the above by reflection. Below is the proposed grammar. But I am not sure what the specification and grammar for "expression" should be. Can you shed some light on it?
{code:java}
CREATE FUNCTION funcName
{
    AS fullClassPath USING JAR 'jarPath' [, 'jarPath]'];
|
    ( data_type paramName [, data_type paramName] )
    RETURNS data_type AS
    BEGIN
        RETURN expression;
    END;
}
{code}

> Support "CREATE FUNCTION" DDL
> -----------------------------
>
>                 Key: CALCITE-2046
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2046
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Shuyi Chen
>            Assignee: Julian Hyde
>            Priority: Major
>
> We want to add DDL support for creating external function like Apache Drill ([https://drill.apache.org/docs/create-function-using-jar/]). 
> {code:java}
> CREATE FUNCTION USING JAR '<jar_name>.jar';
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)