I am working on a Hive UDF in Scala
class MyUDF extends UDF {
def func(a: Double): Double {
if (cond){ how to return null in this case? }
else {some double}
}
}
I tried null.asInstanceOf[Double] but this gives the output as 0. I need a NULL output in hive instead.
Thanks.
A Scala
Doublecannot benull. Can you change the interface to return ajava.lang.Double?