hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <edlinuxg...@gmail.com>
Subject Re: hadoop.io.DoubleWritable v/s hive.serde2.io.DoubleWritable
Date Tue, 12 Jun 2012 21:11:56 GMT
If you use Double or double hive will automatically convert. I would
always recommend the hive.serde types.

Edward

On Tue, Jun 12, 2012 at 4:56 PM,  <richin.jain@nokia.com> wrote:
> Hi Guys,
>
>
>
> I am writing a UDF in hive to convert a double value to string, so the
> evaluate method of my UDF class looks like
>
>
>
> import org.apache.hadoop.hive.ql.exec.UDF;
>
> import org.apache.hadoop.io.Text;
>
> //import org.apache.hadoop.io.DoubleWritable; - does not work
>
> import org.apache.hadoop.hive.serde2.io.DoubleWritable;
>
>
>
> public Text evaluate(DoubleWritable d){
>
>
>
> }
>
>
>
> When I looked at different UDF examples the Hadoop Writables seem to work
> fine in case of Text and IntWritable but for DoubleWritable I was getting an
> error. I figured out looking at couple of examples online that I should use
> the DoubleWritable from hive.serde2 package instead of hadoop.io package.
>
>
>
> Can someone please explain why this special case for DoubleWritable?
>
>
>
> Thanks,
>
> Richin

Mime
View raw message