You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Mohan Agarwal <mo...@gmail.com> on 2009/11/26 07:53:52 UTC

Problem regarding UDF

Hi,
    *I have created a simple User Define Function (namely "my_lower" which
converts all the characters of input text to lower case and return the
modified text).* *I have to register this function  every time after staring
Hive using command  "create temporary function my_lower as
'com.example.hive.udf.Lower";

Can someone help to solve this problem,so that I don't have to register UDF
every time after starting Hive;
*
Thanking You
Mohan Agarwal*
*

Re: Problem regarding UDF

Posted by Mohan Agarwal <mo...@gmail.com>.
Hi Edward,
 I didn't get any file called ".hiverc" in Hive installation directory,
where I can put my all commands which can be executed on starting hive. Even
I search on Internet for ".hiverc" but didn't get any right conclusion.
    Please help me to solve this problem.

Thanking You
Mohan Agarwal



On Thu, Nov 26, 2009 at 10:46 PM, Edward Capriolo <ed...@gmail.com>wrote:

> Mohan,
>
> There is a couple things here.
>
> I think a lcase udf already exists.
>
> You need to things
> add jar '/path/to/udf'
> create function
>
> If you want this to always be there. There is a jira open for a
> .hiverc that can run a set of commands on startup.
>
> You can also just patch FunctionRegistry, it is in the ql subfolder.
> That is how UDFs are added to hive permanently.
>
> On Thu, Nov 26, 2009 at 1:53 AM, Mohan Agarwal
> <mo...@gmail.com> wrote:
> > Hi,
> >     I have created a simple User Define Function (namely "my_lower" which
> > converts all the characters of input text to lower case and return the
> > modified text). I have to register this function  every time after
> staring
> > Hive using command  "create temporary function my_lower as
> > 'com.example.hive.udf.Lower";
> >
> > Can someone help to solve this problem,so that I don't have to register
> UDF
> > every time after starting Hive;
> >
> > Thanking You
> > Mohan Agarwa
> >
>

Re: Problem regarding UDF

Posted by Edward Capriolo <ed...@gmail.com>.
Mohan,

There is a couple things here.

I think a lcase udf already exists.

You need to things
add jar '/path/to/udf'
create function

If you want this to always be there. There is a jira open for a
.hiverc that can run a set of commands on startup.

You can also just patch FunctionRegistry, it is in the ql subfolder.
That is how UDFs are added to hive permanently.

On Thu, Nov 26, 2009 at 1:53 AM, Mohan Agarwal
<mo...@gmail.com> wrote:
> Hi,
>     I have created a simple User Define Function (namely "my_lower" which
> converts all the characters of input text to lower case and return the
> modified text). I have to register this function  every time after staring
> Hive using command  "create temporary function my_lower as
> 'com.example.hive.udf.Lower";
>
> Can someone help to solve this problem,so that I don't have to register UDF
> every time after starting Hive;
>
> Thanking You
> Mohan Agarwa
>