You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Denny Lee <de...@gmail.com> on 2012/06/27 04:31:22 UTC

Making UDFs "permanent"

We have a scenario where we want to make a UDF permanent so that way a
query through the HiveODBC driver will be able to access the UDF.  I seem
to recall that after creating the UDF, you can make it "permanent" by
adding it into the Function Registry.

But it seems that I also need to rebuild the hive-exec-*.jar and bundle my
UDF within it. Is this actually a necessary step or is it possible to
register my UDFs and make them permanent?

Thanks!
Denny

Re: Making UDFs "permanent"

Posted by phil young <ph...@gmail.com>.
If you trace the source code, you'll find it's not too hard to change to
let a user specify a UDF. But, that's changing the code...

Ed Capriolo posted a more useful response a while back, on the general Hive
mailing list:
"You have the option now to run HQL by creating a hiverc file
https://issues.apache.org/jira/browse/HIVE-1414."


-Phil





On Wed, Jun 27, 2012 at 6:26 AM, Denny Lee <de...@gmail.com> wrote:

> Thanks Jasper - much appreciated!
>
>
> On Tue, Jun 26, 2012 at 10:27 PM, Jasper Knulst <
> jasper.knulst@incentro.com> wrote:
>
>> Hi Denny,
>>
>> I asked the same question a few days ago and got this reference to
>> another question:
>>
>> "If you want to make your temporary function permanent , you have to
>> patch hive source code. Please refer to this discussion
>>
>> http://mail-archives.apache.org/mod_mbox/hive-user/201101.mbox/%3CAANLkTimbx1rSkKWqi1pnnhrjkgc9cjuRuN_BE8YOYOks@mail.gmail.com%3E
>> "
>>
>>
>> So you are right, the only way seems to be to rebuild hive-exec-*
>> yourself.
>>
>> I solved the issue temporarily by invoking a hive script ( with hive -i
>> '/path/to/hive-init.sql')  command that does the repetitive commands for
>> me. When you create a nix alias (alias hive='hive -i
>> "/path/to/hive_init.sql" ') for it it works fine for me.
>>
>>
>> Jasper
>>
>>
>>
>>
>> 2012/6/27 Denny Lee <de...@gmail.com>
>>
>>> We have a scenario where we want to make a UDF permanent so that way a
>>> query through the HiveODBC driver will be able to access the UDF.  I seem
>>> to recall that after creating the UDF, you can make it "permanent" by
>>> adding it into the Function Registry.
>>>
>>> But it seems that I also need to rebuild the hive-exec-*.jar and bundle
>>> my UDF within it. Is this actually a necessary step or is it possible to
>>> register my UDFs and make them permanent?
>>>
>>> Thanks!
>>> Denny
>>>
>>>
>>
>>
>> --
>>
>
>

Re: Making UDFs "permanent"

Posted by Denny Lee <de...@gmail.com>.
Thanks Jasper - much appreciated!

On Tue, Jun 26, 2012 at 10:27 PM, Jasper Knulst
<ja...@incentro.com>wrote:

> Hi Denny,
>
> I asked the same question a few days ago and got this reference to another
> question:
>
> "If you want to make your temporary function permanent , you have to patch
> hive source code. Please refer to this discussion
>
> http://mail-archives.apache.org/mod_mbox/hive-user/201101.mbox/%3CAANLkTimbx1rSkKWqi1pnnhrjkgc9cjuRuN_BE8YOYOks@mail.gmail.com%3E
> "
>
>
> So you are right, the only way seems to be to rebuild hive-exec-* yourself.
>
> I solved the issue temporarily by invoking a hive script ( with hive -i
> '/path/to/hive-init.sql')  command that does the repetitive commands for
> me. When you create a nix alias (alias hive='hive -i
> "/path/to/hive_init.sql" ') for it it works fine for me.
>
>
> Jasper
>
>
>
>
> 2012/6/27 Denny Lee <de...@gmail.com>
>
>> We have a scenario where we want to make a UDF permanent so that way a
>> query through the HiveODBC driver will be able to access the UDF.  I seem
>> to recall that after creating the UDF, you can make it "permanent" by
>> adding it into the Function Registry.
>>
>> But it seems that I also need to rebuild the hive-exec-*.jar and bundle
>> my UDF within it. Is this actually a necessary step or is it possible to
>> register my UDFs and make them permanent?
>>
>> Thanks!
>> Denny
>>
>>
>
>
> --
>

Re: Making UDFs "permanent"

Posted by Jasper Knulst <ja...@incentro.com>.
Hi Denny,

I asked the same question a few days ago and got this reference to another
question:

"If you want to make your temporary function permanent , you have to patch
hive source code. Please refer to this discussion
http://mail-archives.apache.org/mod_mbox/hive-user/201101.mbox/%3CAANLkTimbx1rSkKWqi1pnnhrjkgc9cjuRuN_BE8YOYOks@mail.gmail.com%3E
"


So you are right, the only way seems to be to rebuild hive-exec-* yourself.

I solved the issue temporarily by invoking a hive script ( with hive -i
'/path/to/hive-init.sql')  command that does the repetitive commands for
me. When you create a nix alias (alias hive='hive -i
"/path/to/hive_init.sql" ') for it it works fine for me.


Jasper



2012/6/27 Denny Lee <de...@gmail.com>

> We have a scenario where we want to make a UDF permanent so that way a
> query through the HiveODBC driver will be able to access the UDF.  I seem
> to recall that after creating the UDF, you can make it "permanent" by
> adding it into the Function Registry.
>
> But it seems that I also need to rebuild the hive-exec-*.jar and bundle my
> UDF within it. Is this actually a necessary step or is it possible to
> register my UDFs and make them permanent?
>
> Thanks!
> Denny
>
>


--