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
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
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
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
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
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
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
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
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<
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
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!
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
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
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
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
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:
>
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
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
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
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
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
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..
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
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
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
25 matches
Mail list logo