You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2014/07/06 02:19:33 UTC

[jira] [Commented] (OPTIQ-314) Allow simple UDFs based on methods

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

Julian Hyde commented on OPTIQ-314:
-----------------------------------

Now if you specify {{methodName}}, Optiq finds all methods with that name in the class. (It excludes non-static ones if the class does not have a public zero-args constructor.) Overloads are resolved based on runtime arguments.

If you specify {{methodName='*'}} it loads all methods, as above. You don't need to specify {{name}}; the name of the function is based on the name of the method.

You cannot use {{methodName}} with aggregate functions. (They require several implementation methods, with fixed names.)

As part of this change, I also improved how overloaded argument lists are resolved. In particular, an Object parameter becomes a SQL ANY type and can thus match anything.

I also added {{OptiqAssert.AssertQuery.returnsValue}}, to make it easier to test statements that return 1 row with 1 column.

> Allow simple UDFs based on methods
> ----------------------------------
>
>                 Key: OPTIQ-314
>                 URL: https://issues.apache.org/jira/browse/OPTIQ-314
>             Project: Optiq
>          Issue Type: New Feature
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> We already allow UDFs based on classes, provided that that classes have just one method. This change would allow UDFs based on classes with several methods.
> E.g. should be able to use 'String String.replace(String s, String s2)' as a SQL UDF 'REPLACE(String, String, String) RETURNS String'.



--
This message was sent by Atlassian JIRA
(v6.2#6252)