You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Tamil A <4t...@gmail.com> on 2012/09/06 14:25:52 UTC

UDAF:FAILED: Execution Error

Hi Experts,

I have written an UDAF function and followed the below steps.

Step 1:
Export jar file

Step 2:
hive>ADD JAR /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;
(also tried with hive --auxpath
/userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;

                      export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:
/userdata/tamil/SumOfColumnTest/AvgOfColumn.jar)
hive>list jar;
/userdata/tamil/SumOfColumnTest/AvgOfColumn.jar

Step 3;
hive>CREATE TEMPORARY FUNCTION avge AS 'com.hadoopbook.hive.UDAFExampleAvg';

but after this got the below error,
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.FunctionTask

is the above procedure i followed is same for UDF and UDAF or some other
changes are to be made for UDAF.


Please help me out,

Thanks & Regards,
Tamil

Re: UDAF:FAILED: Execution Error

Posted by Tamil A <4t...@gmail.com>.
Hi Matouk,
Thank you so much for your reply, problem is with the classpath. Now it
works fine.


Regards,
Tamil
On Thu, Sep 6, 2012 at 9:26 PM, Matouk Iftissen <mi...@cyres.fr> wrote:

>  Hello, ****
>
> **·         **With UDF you do this :****
>
> package com.example.hive.udf;****
>
> import org.apache.hadoop.hive.ql.exec.UDF;****
>
> ** **
>
> public final class Maclass extends UDF{…..}****
>
> ** **
>
> **·         **then you generate your  jar  monjar.jar (for example) with
> java class (maclass)****
>
> **·         **you add you jar to hive:****
>
> hive> add jar Maclass.jar****
>
> ** **
>
> **·         **you create then an UDF like:****
>
> hive> create temporary function mafonction as 'com.example.hive.udf.monjar';****
>
> ** **
>
> **·         **and then use mafonction in hive query*.*
>
> ** **
>
> Hope that this help you****
>
> ** **
>
> Best regard ****
>
> Matouk.****
>
> *De :* Tamil A [mailto:4tamils04@gmail.com]
> *Envoyé :* jeudi 6 septembre 2012 14:26
> *À :* user@hive.apache.org
> *Objet :* UDAF:FAILED: Execution Error****
>
> ** **
>
> Hi Experts,****
>
> ** **
>
> I have written an UDAF function and followed the below steps.****
>
> ** **
>
> Step 1:****
>
> Export jar file****
>
> ** **
>
> Step 2:****
>
> hive>ADD JAR /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;****
>
> (also tried with hive --auxpath
> /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;****
>
>                       export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:
> /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar)****
>
> hive>list jar;****
>
> /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar****
>
> ** **
>
> Step 3;****
>
> hive>CREATE TEMPORARY FUNCTION avge AS
> 'com.hadoopbook.hive.UDAFExampleAvg';****
>
> ** **
>
> but after this got the below error,****
>
> FAILED: Execution Error, return code 1 from
> org.apache.hadoop.hive.ql.exec.FunctionTask****
>
> ** **
>
> is the above procedure i followed is same for UDF and UDAF or some other
> changes are to be made for UDAF.****
>
> ** **
>
> ** **
>
> Please help me out,****
>
> ** **
>
> Thanks & Regards,****
>
> Tamil****
>
> ** **
>

RE: UDAF:FAILED: Execution Error

Posted by Matouk Iftissen <mi...@cyres.fr>.
Hello,

·         With UDF you do this :

package com.example.hive.udf;

import org.apache.hadoop.hive.ql.exec.UDF;



public final class Maclass extends UDF{.....}



·         then you generate your  jar  monjar.jar (for example) with java class (maclass)

·         you add you jar to hive:

hive> add jar Maclass.jar


·         you create then an UDF like:

hive> create temporary function mafonction as 'com.example.hive.udf.monjar';


·         and then use mafonction in hive query.

Hope that this help you

Best regard
Matouk.
De : Tamil A [mailto:4tamils04@gmail.com]
Envoyé : jeudi 6 septembre 2012 14:26
À : user@hive.apache.org
Objet : UDAF:FAILED: Execution Error

Hi Experts,

I have written an UDAF function and followed the below steps.

Step 1:
Export jar file

Step 2:
hive>ADD JAR /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;
(also tried with hive --auxpath /userdata/tamil/SumOfColumnTest/AvgOfColumn.jar;
                      export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/userdata/tamil/SumOfColumnTest/AvgOfColumn.jar)
hive>list jar;
/userdata/tamil/SumOfColumnTest/AvgOfColumn.jar

Step 3;
hive>CREATE TEMPORARY FUNCTION avge AS 'com.hadoopbook.hive.UDAFExampleAvg';

but after this got the below error,
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.FunctionTask

is the above procedure i followed is same for UDF and UDAF or some other changes are to be made for UDAF.


Please help me out,

Thanks & Regards,
Tamil