Re: handling null argument in custom udf

2012-12-06 Thread Søren
: Vivek Mishra Sent: 05 December 2012 15:36 To: user@hive.apache.org Subject: RE: handling null argument in custom udf Could you please look into and share your task log/attemptlog for complete error trace or actual error behind this? -Vivek From: Søren [s

RE: handling null argument in custom udf

2012-12-05 Thread Vivek Mishra
From: Vivek Mishra Sent: 05 December 2012 15:36 To: user@hive.apache.org Subject: RE: handling null argument in custom udf Could you please look into and share your task log/attemptlog for complete error trace or actual error behind this? -Vivek

RE: handling null argument in custom udf

2012-12-05 Thread Vivek Mishra
Could you please look into and share your task log/attemptlog for complete error trace or actual error behind this? -Vivek From: Søren [s...@syntonetic.com] Sent: 04 December 2012 20:28 To: user@hive.apache.org Subject: Re: handling null argument in

Re: handling null argument in custom udf

2012-12-04 Thread Mark Grover
Soren, Can you give the complete stack trace? Or share the code? Perhaps, the skeletal code. Look at Ceil UDF for example, it has a null check, you should be able to do something similar: https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCeil.java#L43 I would e

Re: handling null argument in custom udf

2012-12-04 Thread Søren
Thanks. Did you mean I should handle null in my udf or my serde? I did try to check for null inside the code in my udf, but it fails even before it gets called. This is from when the udf fails: Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to execute method public o

Re: handling null argument in custom udf

2012-12-04 Thread Edward Capriolo
There is no null argument. You should handle the null case in your code. If (arga == null) Or optionally you could use a generic udf but a regular one should handle what you are doing. On Tuesday, December 4, 2012, Søren wrote: > Hi Hive community > > I have a custom udf, say myfun, written in

handling null argument in custom udf

2012-12-04 Thread Søren
Hi Hive community I have a custom udf, say myfun, written in Java which I utilize like this select myfun(col_a, col_b) from mytable where etc col_b is a string type and sometimes it is null. When that happens, my query crashes with --- java.lang.RuntimeException: org.apache.ha