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