hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From longmans163 <longmans...@163.com>
Subject Re:urldecode hive column
Date Fri, 16 Sep 2011 06:04:51 GMT
It's easy to write a udf by yourself.
such as:


import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
import java.net.URLDecoder;
import java.io.UnsupportedEncodingException;


public class urlDecoder extends UDF{
public urlDecoder(){
}
private Text text = new Text();
public Text evaluate(final Text column) throws UnsupportedEncodingException{
text.clear();
String columnString = column.toString();
if(column != null){
text = new Text(URLDecoder.decode(columnString, "UTF-8"));
}
   return text;
}
}



At 2011-09-16 00:03:59,"Chalcy Raja" <Chalcy.Raja@careerbuilder.com> wrote:


Hi,

 

I have a situation where I need to do urldecode on one particular column.  Is there any hive
built in function available?

 

Thank you,

Chalcy
Mime
View raw message