Re: Hive UDF error

2014-05-16 Thread Jason Dere
What version of Hive are you running? It looks like the error you're seeing might be from Hive trying to retrieve the error message from the logs and might not be related to the actual error. Might want to check the logs for the Hadoop task that was run as part of this query, to see if that ha

Hive UDF error

2014-05-16 Thread Leena Gupta
Hi, I'm trying to create a function that generates a UUID, want to use it in a query to insert data into another table. Here is the function: package com.udf.example; import java.util.UUID; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.UDF; import o

Re: Hive UDF error

2014-05-16 Thread Edward Capriolo
try public class Uuid extends UDF{ On Thu, May 15, 2014 at 2:07 PM, Leena Gupta wrote: > Hi, > > I'm trying to create a function that generates a UUID, want to use it in a > query to insert data into another table. > > Here is the function: > > package com.udf.example; > > import java.util.UUI

Re: HIVE UDF Error

2014-04-09 Thread Rishabh Bhardwaj
Thanks Nitin Its done now. The problem was this that I have to store the class file in the sam directory structure as I have described in package declaration line in the java code. Rishabh On Wednesday, 9 April 2014 12:43 PM, Nitin Pawar wrote: Follow the steps as it is from the link I shar

Re: HIVE UDF Error

2014-04-09 Thread Nitin Pawar
Follow the steps as it is from the link I shared .. it works Somehow your package is getting messed and it is not able to find the class On Wed, Apr 9, 2014 at 12:27 PM, Rishabh Bhardwaj wrote: > I added, > package rishabh.udf.hive; > in the above code. > and repeated the steps. > But Now getti

Re: HIVE UDF Error

2014-04-08 Thread Rishabh Bhardwaj
I added, package rishabh.udf.hive; in the above code. and repeated the steps. But Now getting the following error, hive> create temporary function helloworld as 'rishabh.udf.hive.SimpleUDFExample'; FAILED: Class rishabh.udf.hive.SimpleUDFExample not found FAILED: Execution Error, return code 1 f

Re: HIVE UDF Error

2014-04-08 Thread Nitin Pawar
in your code and that code package is missing what you need to do is define package something like package org.apache.hadoop.hive.ql.udf; then your add function definition becomes CREATE TEMPORARY FUNCTION AS 'org.apache.hadoop.hive.ql.udf.'; feel free to use any package name you wish but mak

Re: HIVE UDF Error

2014-04-08 Thread Rishabh Bhardwaj
Hi Nitin, Thanks for the concern. Here is the code of the UDF, import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.io.Text; @Description(   name="SimpleUDFExample",   value="returns 'hello x', where x is whatever you give it (STRI

Re: HIVE UDF Error

2014-04-08 Thread Nitin Pawar
Can you put first few lines of your code here or upload code on github and share the link? On Wed, Apr 9, 2014 at 11:59 AM, Rishabh Bhardwaj wrote: > Hi all, > I have done the following steps to create a UDF in hive but getting > error.Please help me. > 1. Created the udf as described > here<

HIVE UDF Error

2014-04-08 Thread Rishabh Bhardwaj
Hi all, I have done the following steps to create a UDF in hive but getting error.Please help me. 1. Created the udf as described here. 2. Compiled it successfully. 3. Copy the class file to a directory hiveudfs. 4. Added it to a jar with this command: jar -cf hiveudfs.jar hiveudfs/SimpleUDFExamp

Re: Help with simple UDF error.. [fixed]

2014-02-13 Thread Manish
On 2/13/14, 9:20 AM, John Meagher wrote: Try changing ArrayList to just List as the argument to the evaluate function. +1 worked thanks!

Re: Help with simple UDF error..

2014-02-13 Thread John Meagher
Try changing ArrayList to just List as the argument to the evaluate function. On Thu, Feb 13, 2014 at 12:15 PM, Manish wrote: > Hello: > While running the hive query : > > hive> select "Actor", count (*) from metrics where > array_contains(type_tuple, "Actor") and checkAttributes (attribute_tuple

Help with simple UDF error..

2014-02-13 Thread Manish
Hello: While running the hive query : hive> select "Actor", count (*) from metrics where array_contains(type_tuple, "Actor") and checkAttributes (attribute_tuple, "p1", "Actor") ; I get this error : FAILED: SemanticException [Error 10014]: Line 1:103 Wrong arguments '"Actor"': No matching m

Re: UDF error?

2013-10-04 Thread Edward Capriolo
Bu default udfs are marked deterministic if you are giving a determini as tic udf no args or constant args the query planner might only calculate the value once. See the udftype annotation class. On Monday, September 30, 2013, Yang wrote: > ok I found the reason, as I modified the jar file, t

Re: UDF error?

2013-09-30 Thread Yang
ok I found the reason, as I modified the jar file, though I re-ran "ADD .MyUdf.jar; create temporary function ; ", it doesn't take effect. I have to get out of hive session, then rerun these again. On Mon, Sep 30, 2013 at 1:47 PM, Yang wrote: > I wrote a super simple UDF, but got s

Re: UDF error?

2013-09-30 Thread Tim Robertson
Here is an example of a no arg that will return a different value for each row: https://code.google.com/p/gbif-occurrencestore/source/browse/trunk/occurrence-store/src/main/java/org/gbif/occurrencestore/hive/udf/UuidUDF.java Hope this helps, Tim On Mon, Sep 30, 2013 at 10:59 PM, Yang wrote: >

Re: UDF error?

2013-09-30 Thread Yang
thanks! at first I did have a no-arg evaluate(), but somehow select myfunction(), field1, field2 from mytable ; spits out the same value for myfunction() for each row. so I was wondering whether the UDF got called only 1 time, because the hive compiler sees that the argument is void, so that all

Re: UDF error?

2013-09-30 Thread Tim Robertson
That class is: https://code.google.com/p/gbif-occurrencestore/source/browse/trunk/occurrence-store/src/main/java/org/gbif/occurrencestore/hive/udf/UDFRowSequence.java Cheers, Tim On Mon, Sep 30, 2013 at 10:55 PM, Tim Robertson wrote: > It's been ages since I wrote one, but the differences to mi

Re: UDF error?

2013-09-30 Thread Tim Robertson
It's been ages since I wrote one, but the differences to mine: a) I use LongWritable: public LongWritable evaluate(LongWritable startAt) { b) I have annotations on the class (but I think they are just for docs) @Description(name = "row_sequence", value = "_FUNC_() - Returns a generated row sequ

UDF error?

2013-09-30 Thread Yang
I wrote a super simple UDF, but got some errors: UDF: package yy; import org.apache.hadoop.hive.ql.exec.UDF; import java.util.Random; import java.util.UUID; import java.lang.management.*; public class MyUdf extends UDF { static Random rand = new Random(System.currentTimeMillis() + Thread

Re: Hive UDF error : numberformat exception (String to Integer) conversion

2012-05-30 Thread Edward Capriolo
Again. Suggest trapping exceptions with try/catch and return null. If you initialize a logger with log4j or commons logging your can log the event and find the failure information by clicking though the job tracker web interface to drill down to the error. On Wed, May 30, 2012 at 12:14 PM, pravee

Re: Hive UDF error : numberformat exception (String to Integer) conversion

2012-05-30 Thread praveenesh kumar
I have done both the things. There is no null issue here. Checked the nulls also. Sorry not mentioned in the code. I also have made a main function and called my evaluate function. If I am passing a string, its working fine. Problem is of numberformat exception. Integer.parseInt is throwing this..

Re: Hive UDF error : numberformat exception (String to Integer) conversion

2012-05-30 Thread Nitin Pawar
i won't tell the error but I would recommend to write a main function in your udf and try with sample inputs which you are expecting in your query. You will know whats the error you are committing On Wed, May 30, 2012 at 8:14 PM, Edward Capriolo wrote: > You should to try catch and return NULL o

Re: Hive UDF error : numberformat exception (String to Integer) conversion

2012-05-30 Thread Edward Capriolo
You should to try catch and return NULL on bad data. The issue is if you have a single bad row the UDF will throw a exception up the chain. It will try again, it will fail again, ultimately the job will fail. On Wed, May 30, 2012 at 10:40 AM, praveenesh kumar wrote: > Hello Hive Users, > > There

Hive UDF error : numberformat exception (String to Integer) conversion

2012-05-30 Thread praveenesh kumar
Hello Hive Users, There is a strange situation I am facing. I have a string column in my Hive table ( its IP address). I am creating a UDF where I am taking this string column and converting it into Long value. Its a simple UDF. Following is my code : package com.practice.hive.udf; public class