You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Tom White (JIRA)" <ji...@apache.org> on 2008/09/11 18:21:54 UTC

[jira] Updated: (HADOOP-4070) [Hive] Provide a mechanism for registering UDFs from the query language

     [ https://issues.apache.org/jira/browse/HADOOP-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated HADOOP-4070:
------------------------------

    Attachment: hadoop-4070.patch

This patch extends the grammar to support creating UDFs.

For example you can do
{noformat}
CREATE FUNCTION my_udf AS com.example.MyUdf;
{noformat}
then use the my_udf function just like any other function.

The class defining the UDF (com.example.MyUdf) should be packed in a jar file then made available to hive by setting the HIVE_AUX_JARS_PATH environment variable (which specifies the directory that the jar is in).

Note that there is a change in ExecDriver which removes some code that was setting the "tmpjars" property incorrectly. The problem was that the paths were not have the "file://" scheme prepended to them as GenericOptionsParser does, which caused the paths to be interpreted as HDFS paths. By removing the code GenericOptionsParser sets the variable correctly.

I have tested it manually on a simple UDF, the next step is to write some automated tests.

> [Hive] Provide a mechanism for registering UDFs from the query language
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4070
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4070
>             Project: Hadoop Core
>          Issue Type: New Feature
>          Components: contrib/hive
>            Reporter: Tom White
>         Attachments: hadoop-4070.patch
>
>
> UDFs (user defined functions) in Hive are currently actually built-in functions. This issue is to develop a packaging and registration mechanism so users can add their own functions at runtime.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.