You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by paradisehi <pa...@126.com> on 2008/12/02 12:06:34 UTC

did hive support the udf now?

My table:a just contains field:url
And Now I wanna compute each domain of url's pv? and out put insert into a table:b domain pv.

Now I didn't know whether the hive support the udf, maybe also I can use map_script to support this.

 

RE: did hive support the udf now?

Posted by Ashish Thusoo <at...@facebook.com>.
Paradisehi,

you can perhaps use the regexp_replace udf to do this.

Basically 

regexp_replace(a.url, '/*$', '') should be able replace everything after the first / with an empty string. The second string which is a regular expression is a java regular expression.

Ashish
________________________________________
From: paradisehi [paradisehit@126.com]
Sent: Tuesday, December 02, 2008 3:06 AM
To: hive-user@hadoop.apache.org
Subject: did hive support the udf now?

My table:a just contains field:url
And Now I wanna compute each domain of url's pv? and out put insert into a table:b domain pv.

Now I didn't know whether the hive support the udf, maybe also I can use map_script to support this.



________________________________
网易免费邮,全球最大的中文免费邮箱<http://www.yeah.net>

Re: did hive support the udf now?

Posted by Zheng Shao <zs...@gmail.com>.
there is a regexp_replace function. Search for that in
http://mirror.facebook.com/facebook/hive/HiveLanguageTutorial.pdf

Zheng

2008/12/2 paradisehi <pa...@126.com>

> My table:a just contains field:url
> And Now I wanna compute each domain of url's pv? and out put insert into a
> table:b domain pv.
>
> Now I didn't know whether the hive support the udf, maybe also I can use
> map_script to support this.
>
>
>
> ------------------------------
> 网易免费邮,全球最大的中文免费邮箱 <http://www.yeah.net>




-- 
Yours,
Zheng