You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Bhavesh Shah <bh...@gmail.com> on 2012/05/10 12:27:28 UTC

hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Hello all,
I have one query. It is executing fine on Hive CLI and returning the result.
But when I am executing it with the help Hive JDBC I am getting error as:

*java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
Execution Error, return code 2 from
org.apache.hadoop.hive.ql.exec.MapRedTask
    at
org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)

*What is the problem? Also I am starting the Hive Thrift Server through
Shell Script. (I have written a shell script which has commad to start Hive
Thrift Server)
Later I decided to start Hive thrift Server manually by typing command as:

hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
Starting Hive Thrift Server
org.apache.thrift.transport.TTransportException: Could not create
ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
hadoop@ubuntu:~/hive-0.7.1$

Please help me out from this.
Thanks

*
*--
Regards,
Bhavesh Shah

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Vinod Singh <vi...@vinodsingh.com>.
At times Hive error message could be misleading. I face similar error
message while running query by embedding Hive in my application. Though
actual error message in my case is, which is not propagated properly-

FAILED: Error in semantic analysis: Line 3:2 Invalid function abc

See if you are doing something different on CLI.

Thanks,
Vinod

On Fri, May 11, 2012 at 1:56 PM, Bhavesh Shah <bh...@gmail.com>wrote:

> One more I problem I am facing is that,
> My program is executing well, All queries are executing one after another
> and giving the result. But there is a one query at which
> always program gives me error as:
> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
> Execution Error, return code 2 from
> org.apache.hadoop.hive.ql.exec.MapRedTask
>     at
> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>     at PracticeExecutiveSummary.main(PracticeExecutiveSummary.java:127)
>
> I tried this on Hive CLi. It is giving result. I checked all logs but no
> errors I found in it.
> Actually What is the problem? Also in previous mail I post my errors which
> are occured during running JAR.
> What is that one? For what it is coming?
>
> Please tell me about it.
> Thanks
>
>
> On Fri, May 11, 2012 at 12:00 PM, Bhavesh Shah <bh...@gmail.com>wrote:
>
>> Thanks Shashwat.
>> I added that and it works.
>> Now my program is running. I have created a JAR of it and tried to
>> execute but again some errors are there while executing JAR only.
>> Error as:
>>
>> hadoop@ubuntu:~$ java -jar PES.jar
>> SLF4J: Class path contains multiple SLF4J bindings.
>> SLF4J: Found binding in
>> [jar:rsrc:slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>> SLF4J: Found binding in
>> [jar:rsrc:slf4j-log4j12-1.6.1_2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> explanation.
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>>
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>     at
>> org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
>> Caused by: java.lang.IncompatibleClassChangeError: class
>> com.facebook.fb303.FacebookService$Client has interface
>> org.apache.thrift.TServiceClient as super class
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>>     at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>>     at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>>     at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>>     at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>     at
>> org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:93)
>>     at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
>>     at java.sql.DriverManager.getConnection(DriverManager.java:582)
>>     at java.sql.DriverManager.getConnection(DriverManager.java:185)
>>     at
>> PracticeExecutiveSummary.dropAllTables(PracticeExecutiveSummary.java:1320)
>>     at PracticeExecutiveSummary.main(PracticeExecutiveSummary.java:43)
>>     ... 5 more
>> hadoop@ubuntu:~$
>>
>>
>> On Fri, May 11, 2012 at 11:40 AM, shashwat shriparv <
>> dwivedishashwat@gmail.com> wrote:
>>
>>> have you added  *hive_hbase-handler.jar*  to your project
>>>
>>>
>>> On Fri, May 11, 2012 at 10:13 AM, Bhavesh Shah <bh...@gmail.com>wrote:
>>>
>>>> I perform all this above steps and whenI tried to run in eclipse I got
>>>> error.
>>>> The error as:
>>>>
>>>> *java.sql.SQLException: Method not supported
>>>>     at
>>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:210)
>>>>     at TestSP.quarterTable(TestSP.java:598)
>>>>     at TestSP.main(TestSP.java:73)
>>>> *
>>>>
>>>> On Thu, May 10, 2012 at 8:49 PM, shashwat shriparv <
>>>> dwivedishashwat@gmail.com> wrote:
>>>>
>>>>> Addition to my last reply ,,, come out from hive cli.. when you are
>>>>> going to run your jdbc code. and dont try to connect using cli when your
>>>>> jdbc code is running....
>>>>>
>>>>> Cheers
>>>>> Shashwat.
>>>>>
>>>>>
>>>>> On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
>>>>> dwivedishashwat@gmail.com> wrote:
>>>>>
>>>>>> For this error : "
>>>>>> *java.sql.SQLException: Query returned non-zero code: 9, cause:
>>>>>> FAILED: Execution Error, return code 2 from
>>>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>>>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>>>>>>
>>>>>> Go to this link :
>>>>>> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>>>>>>
>>>>>>
>>>>>> and add
>>>>>>
>>>>>>
>>>>>> hadoop-0.20-core.jar
>>>>>> hive/lib/hive-exec-0.7.1.jar
>>>>>> hive/lib/hive-jdbc-0.7.1.jar
>>>>>> hive/lib/hive-metastore-0.7.1.jar
>>>>>> hive/lib/hive-service-0.7.1.jar
>>>>>> hive/lib/libfb303.jar
>>>>>> lib/commons-logging-1.0.4.jar
>>>>>> slf4j-api-1.6.1.jar
>>>>>> slf4j-log4j12-1.6.1.jar
>>>>>>
>>>>>>
>>>>>> to the class path of your project , add this jars from the lib of
>>>>>> hadoop and hive, and try the code. and also add the path of hadoop, hive,
>>>>>> and hbase(if your are using) lib folder path to the project class path,
>>>>>> like you have added the jars.
>>>>>>
>>>>>> and for the second error you got
>>>>>>
>>>>>> type
>>>>>>
>>>>>> netstat -nl | grep 10000
>>>>>>
>>>>>> if it shows something means hive server is already running. the
>>>>>> second error comes only when the port you are specifying is already
>>>>>> acquired by some other proces, by default server port is 10000 so very with
>>>>>> the above netstat command which i said.
>>>>>>
>>>>>> Note : suppose you have connected using code exit from ... bin/hive
>>>>>>  of if you are connected through bin/hive > then code will not connect
>>>>>> because i think (not sure) only one client can connect to the hive server.
>>>>>>
>>>>>> do above steps hopefully will solve your problem.
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> ∞
>>>>>> Shashwat Shriparv
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com>wrote:
>>>>>>
>>>>>>> Hi Bhavesh,
>>>>>>> You will have to check your Jobtracker logs for more details. If you
>>>>>>> are using AWS, they should be in your S3 logs directory under
>>>>>>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>>>>>>
>>>>>>> Mark
>>>>>>>
>>>>>>> Mark Grover, Business Intelligence Analyst
>>>>>>> OANDA Corporation
>>>>>>>
>>>>>>> www: oanda.com www: fxtrade.com
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>> From: "Bhavesh Shah" <bh...@gmail.com>
>>>>>>> To: user@hive.apache.org, dev@hive.apache.org
>>>>>>> Sent: Thursday, May 10, 2012 6:27:28 AM
>>>>>>> Subject: hive failed execution error return code 2 from
>>>>>>> org.apache.hadoop.hive.ql.exec.mapredtask
>>>>>>>
>>>>>>> Hello all,
>>>>>>> I have one query. It is executing fine on Hive CLI and returning the
>>>>>>> result.
>>>>>>> But when I am executing it with the help Hive JDBC I am getting
>>>>>>> error as:
>>>>>>>
>>>>>>> java.sql.SQLException: Query returned non-zero code: 9, cause:
>>>>>>> FAILED: Execution Error, return code 2 from
>>>>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>>>> at
>>>>>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>>>>>>
>>>>>>> What is the problem? Also I am starting the Hive Thrift Server
>>>>>>> through Shell Script. (I have written a shell script which has commad to
>>>>>>> start Hive Thrift Server)
>>>>>>> Later I decided to start Hive thrift Server manually by typing
>>>>>>> command as:
>>>>>>>
>>>>>>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>>>>>>> Starting Hive Thrift Server
>>>>>>> org.apache.thrift.transport.TTransportException: Could not create
>>>>>>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>>>>>>> at
>>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>>>>>>> at
>>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>>>>>>> at
>>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>>>>>>> at
>>>>>>> org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>> at
>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>>> at
>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>>>>>>> hadoop@ubuntu:~/hive-0.7.1$
>>>>>>>
>>>>>>> Please help me out from this.
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>> Bhavesh Shah
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>> ∞
>>>>>> Shashwat Shriparv
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>> ∞
>>>>> Shashwat Shriparv
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Bhavesh Shah
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>>
>>> ∞
>>> Shashwat Shriparv
>>>
>>>
>>>
>>
>>
>> --
>> Regards,
>> Bhavesh Shah
>>
>>
>
>
> --
> Regards,
> Bhavesh Shah
>
>

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Bhavesh Shah <bh...@gmail.com>.
One more I problem I am facing is that,
My program is executing well, All queries are executing one after another
and giving the result. But there is a one query at which
always program gives me error as:
java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
Execution Error, return code 2 from
org.apache.hadoop.hive.ql.exec.MapRedTask
    at
org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
    at PracticeExecutiveSummary.main(PracticeExecutiveSummary.java:127)

I tried this on Hive CLi. It is giving result. I checked all logs but no
errors I found in it.
Actually What is the problem? Also in previous mail I post my errors which
are occured during running JAR.
What is that one? For what it is coming?

Please tell me about it.
Thanks


On Fri, May 11, 2012 at 12:00 PM, Bhavesh Shah <bh...@gmail.com>wrote:

> Thanks Shashwat.
> I added that and it works.
> Now my program is running. I have created a JAR of it and tried to execute
> but again some errors are there while executing JAR only.
> Error as:
>
> hadoop@ubuntu:~$ java -jar PES.jar
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
> [jar:rsrc:slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:rsrc:slf4j-log4j12-1.6.1_2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
> explanation.
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
> Caused by: java.lang.IncompatibleClassChangeError: class
> com.facebook.fb303.FacebookService$Client has interface
> org.apache.thrift.TServiceClient as super class
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>     at
> org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:93)
>     at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
>     at java.sql.DriverManager.getConnection(DriverManager.java:582)
>     at java.sql.DriverManager.getConnection(DriverManager.java:185)
>     at
> PracticeExecutiveSummary.dropAllTables(PracticeExecutiveSummary.java:1320)
>     at PracticeExecutiveSummary.main(PracticeExecutiveSummary.java:43)
>     ... 5 more
> hadoop@ubuntu:~$
>
>
> On Fri, May 11, 2012 at 11:40 AM, shashwat shriparv <
> dwivedishashwat@gmail.com> wrote:
>
>> have you added  *hive_hbase-handler.jar*  to your project
>>
>>
>> On Fri, May 11, 2012 at 10:13 AM, Bhavesh Shah <bh...@gmail.com>wrote:
>>
>>> I perform all this above steps and whenI tried to run in eclipse I got
>>> error.
>>> The error as:
>>>
>>> *java.sql.SQLException: Method not supported
>>>     at
>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:210)
>>>     at TestSP.quarterTable(TestSP.java:598)
>>>     at TestSP.main(TestSP.java:73)
>>> *
>>>
>>> On Thu, May 10, 2012 at 8:49 PM, shashwat shriparv <
>>> dwivedishashwat@gmail.com> wrote:
>>>
>>>> Addition to my last reply ,,, come out from hive cli.. when you are
>>>> going to run your jdbc code. and dont try to connect using cli when your
>>>> jdbc code is running....
>>>>
>>>> Cheers
>>>> Shashwat.
>>>>
>>>>
>>>> On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
>>>> dwivedishashwat@gmail.com> wrote:
>>>>
>>>>> For this error : "
>>>>> *java.sql.SQLException: Query returned non-zero code: 9, cause:
>>>>> FAILED: Execution Error, return code 2 from
>>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>>>>>
>>>>> Go to this link :
>>>>> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>>>>>
>>>>>
>>>>> and add
>>>>>
>>>>> hadoop-0.20-core.jar
>>>>> hive/lib/hive-exec-0.7.1.jar
>>>>> hive/lib/hive-jdbc-0.7.1.jar
>>>>> hive/lib/hive-metastore-0.7.1.jar
>>>>> hive/lib/hive-service-0.7.1.jar
>>>>> hive/lib/libfb303.jar
>>>>> lib/commons-logging-1.0.4.jar
>>>>> slf4j-api-1.6.1.jar
>>>>> slf4j-log4j12-1.6.1.jar
>>>>>
>>>>>
>>>>> to the class path of your project , add this jars from the lib of
>>>>> hadoop and hive, and try the code. and also add the path of hadoop, hive,
>>>>> and hbase(if your are using) lib folder path to the project class path,
>>>>> like you have added the jars.
>>>>>
>>>>> and for the second error you got
>>>>>
>>>>> type
>>>>>
>>>>> netstat -nl | grep 10000
>>>>>
>>>>> if it shows something means hive server is already running. the second
>>>>> error comes only when the port you are specifying is already acquired by
>>>>> some other proces, by default server port is 10000 so very with the above
>>>>> netstat command which i said.
>>>>>
>>>>> Note : suppose you have connected using code exit from ... bin/hive
>>>>>  of if you are connected through bin/hive > then code will not connect
>>>>> because i think (not sure) only one client can connect to the hive server.
>>>>>
>>>>> do above steps hopefully will solve your problem.
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> ∞
>>>>> Shashwat Shriparv
>>>>>
>>>>>
>>>>>
>>>>> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com>wrote:
>>>>>
>>>>>> Hi Bhavesh,
>>>>>> You will have to check your Jobtracker logs for more details. If you
>>>>>> are using AWS, they should be in your S3 logs directory under
>>>>>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>> Mark Grover, Business Intelligence Analyst
>>>>>> OANDA Corporation
>>>>>>
>>>>>> www: oanda.com www: fxtrade.com
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> From: "Bhavesh Shah" <bh...@gmail.com>
>>>>>> To: user@hive.apache.org, dev@hive.apache.org
>>>>>> Sent: Thursday, May 10, 2012 6:27:28 AM
>>>>>> Subject: hive failed execution error return code 2 from
>>>>>> org.apache.hadoop.hive.ql.exec.mapredtask
>>>>>>
>>>>>> Hello all,
>>>>>> I have one query. It is executing fine on Hive CLI and returning the
>>>>>> result.
>>>>>> But when I am executing it with the help Hive JDBC I am getting error
>>>>>> as:
>>>>>>
>>>>>> java.sql.SQLException: Query returned non-zero code: 9, cause:
>>>>>> FAILED: Execution Error, return code 2 from
>>>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>>> at
>>>>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>>>>>
>>>>>> What is the problem? Also I am starting the Hive Thrift Server
>>>>>> through Shell Script. (I have written a shell script which has commad to
>>>>>> start Hive Thrift Server)
>>>>>> Later I decided to start Hive thrift Server manually by typing
>>>>>> command as:
>>>>>>
>>>>>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>>>>>> Starting Hive Thrift Server
>>>>>> org.apache.thrift.transport.TTransportException: Could not create
>>>>>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>>>>>> at
>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>>>>>> at
>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>>>>>> at
>>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>>>>>> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>>>>>> hadoop@ubuntu:~/hive-0.7.1$
>>>>>>
>>>>>> Please help me out from this.
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Bhavesh Shah
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>> ∞
>>>>> Shashwat Shriparv
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>> ∞
>>>> Shashwat Shriparv
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards,
>>> Bhavesh Shah
>>>
>>>
>>
>>
>> --
>>
>>
>> ∞
>> Shashwat Shriparv
>>
>>
>>
>
>
> --
> Regards,
> Bhavesh Shah
>
>


-- 
Regards,
Bhavesh Shah

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Bhavesh Shah <bh...@gmail.com>.
Thanks Shashwat.
I added that and it works.
Now my program is running. I have created a JAR of it and tried to execute
but again some errors are there while executing JAR only.
Error as:

hadoop@ubuntu:~$ java -jar PES.jar
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:rsrc:slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:rsrc:slf4j-log4j12-1.6.1_2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.IncompatibleClassChangeError: class
com.facebook.fb303.FacebookService$Client has interface
org.apache.thrift.TServiceClient as super class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at
org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:93)
    at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at
PracticeExecutiveSummary.dropAllTables(PracticeExecutiveSummary.java:1320)
    at PracticeExecutiveSummary.main(PracticeExecutiveSummary.java:43)
    ... 5 more
hadoop@ubuntu:~$


On Fri, May 11, 2012 at 11:40 AM, shashwat shriparv <
dwivedishashwat@gmail.com> wrote:

> have you added  *hive_hbase-handler.jar*  to your project
>
>
> On Fri, May 11, 2012 at 10:13 AM, Bhavesh Shah <bh...@gmail.com>wrote:
>
>> I perform all this above steps and whenI tried to run in eclipse I got
>> error.
>> The error as:
>>
>> *java.sql.SQLException: Method not supported
>>     at
>> org.apache.hadoop.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:210)
>>     at TestSP.quarterTable(TestSP.java:598)
>>     at TestSP.main(TestSP.java:73)
>> *
>>
>> On Thu, May 10, 2012 at 8:49 PM, shashwat shriparv <
>> dwivedishashwat@gmail.com> wrote:
>>
>>> Addition to my last reply ,,, come out from hive cli.. when you are
>>> going to run your jdbc code. and dont try to connect using cli when your
>>> jdbc code is running....
>>>
>>> Cheers
>>> Shashwat.
>>>
>>>
>>> On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
>>> dwivedishashwat@gmail.com> wrote:
>>>
>>>> For this error : "
>>>> *java.sql.SQLException: Query returned non-zero code: 9, cause:
>>>> FAILED: Execution Error, return code 2 from
>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>>>>
>>>> Go to this link :
>>>> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>>>>
>>>>
>>>> and add
>>>>
>>>> hadoop-0.20-core.jar
>>>> hive/lib/hive-exec-0.7.1.jar
>>>> hive/lib/hive-jdbc-0.7.1.jar
>>>> hive/lib/hive-metastore-0.7.1.jar
>>>> hive/lib/hive-service-0.7.1.jar
>>>> hive/lib/libfb303.jar
>>>> lib/commons-logging-1.0.4.jar
>>>> slf4j-api-1.6.1.jar
>>>> slf4j-log4j12-1.6.1.jar
>>>>
>>>>
>>>> to the class path of your project , add this jars from the lib of
>>>> hadoop and hive, and try the code. and also add the path of hadoop, hive,
>>>> and hbase(if your are using) lib folder path to the project class path,
>>>> like you have added the jars.
>>>>
>>>> and for the second error you got
>>>>
>>>> type
>>>>
>>>> netstat -nl | grep 10000
>>>>
>>>> if it shows something means hive server is already running. the second
>>>> error comes only when the port you are specifying is already acquired by
>>>> some other proces, by default server port is 10000 so very with the above
>>>> netstat command which i said.
>>>>
>>>> Note : suppose you have connected using code exit from ... bin/hive
>>>>  of if you are connected through bin/hive > then code will not connect
>>>> because i think (not sure) only one client can connect to the hive server.
>>>>
>>>> do above steps hopefully will solve your problem.
>>>>
>>>>
>>>> Regards
>>>>
>>>> ∞
>>>> Shashwat Shriparv
>>>>
>>>>
>>>>
>>>> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com> wrote:
>>>>
>>>>> Hi Bhavesh,
>>>>> You will have to check your Jobtracker logs for more details. If you
>>>>> are using AWS, they should be in your S3 logs directory under
>>>>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>>>>
>>>>> Mark
>>>>>
>>>>> Mark Grover, Business Intelligence Analyst
>>>>> OANDA Corporation
>>>>>
>>>>> www: oanda.com www: fxtrade.com
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Bhavesh Shah" <bh...@gmail.com>
>>>>> To: user@hive.apache.org, dev@hive.apache.org
>>>>> Sent: Thursday, May 10, 2012 6:27:28 AM
>>>>> Subject: hive failed execution error return code 2 from
>>>>> org.apache.hadoop.hive.ql.exec.mapredtask
>>>>>
>>>>> Hello all,
>>>>> I have one query. It is executing fine on Hive CLI and returning the
>>>>> result.
>>>>> But when I am executing it with the help Hive JDBC I am getting error
>>>>> as:
>>>>>
>>>>> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>>>>> Execution Error, return code 2 from
>>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>>> at
>>>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>>>>
>>>>> What is the problem? Also I am starting the Hive Thrift Server through
>>>>> Shell Script. (I have written a shell script which has commad to start Hive
>>>>> Thrift Server)
>>>>> Later I decided to start Hive thrift Server manually by typing command
>>>>> as:
>>>>>
>>>>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>>>>> Starting Hive Thrift Server
>>>>> org.apache.thrift.transport.TTransportException: Could not create
>>>>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>>>>> at
>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>>>>> at
>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>>>>> at
>>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>>>>> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>>>>> hadoop@ubuntu:~/hive-0.7.1$
>>>>>
>>>>> Please help me out from this.
>>>>> Thanks
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Bhavesh Shah
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>> ∞
>>>> Shashwat Shriparv
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>>
>>> ∞
>>> Shashwat Shriparv
>>>
>>>
>>>
>>
>>
>> --
>> Regards,
>> Bhavesh Shah
>>
>>
>
>
> --
>
>
> ∞
> Shashwat Shriparv
>
>
>


-- 
Regards,
Bhavesh Shah

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by shashwat shriparv <dw...@gmail.com>.
have you added  *hive_hbase-handler.jar*  to your project

On Fri, May 11, 2012 at 10:13 AM, Bhavesh Shah <bh...@gmail.com>wrote:

> I perform all this above steps and whenI tried to run in eclipse I got
> error.
> The error as:
>
> *java.sql.SQLException: Method not supported
>     at
> org.apache.hadoop.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:210)
>     at TestSP.quarterTable(TestSP.java:598)
>     at TestSP.main(TestSP.java:73)
> *
>
> On Thu, May 10, 2012 at 8:49 PM, shashwat shriparv <
> dwivedishashwat@gmail.com> wrote:
>
>> Addition to my last reply ,,, come out from hive cli.. when you are going
>> to run your jdbc code. and dont try to connect using cli when your jdbc
>> code is running....
>>
>> Cheers
>> Shashwat.
>>
>>
>> On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
>> dwivedishashwat@gmail.com> wrote:
>>
>>> For this error : "
>>> *java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>>> Execution Error, return code 2 from
>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>>>
>>> Go to this link :
>>> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>>>
>>>
>>> and add
>>>
>>> hadoop-0.20-core.jar
>>> hive/lib/hive-exec-0.7.1.jar
>>> hive/lib/hive-jdbc-0.7.1.jar
>>> hive/lib/hive-metastore-0.7.1.jar
>>> hive/lib/hive-service-0.7.1.jar
>>> hive/lib/libfb303.jar
>>> lib/commons-logging-1.0.4.jar
>>> slf4j-api-1.6.1.jar
>>> slf4j-log4j12-1.6.1.jar
>>>
>>>
>>> to the class path of your project , add this jars from the lib of hadoop
>>> and hive, and try the code. and also add the path of hadoop, hive, and
>>> hbase(if your are using) lib folder path to the project class path, like
>>> you have added the jars.
>>>
>>> and for the second error you got
>>>
>>> type
>>>
>>> netstat -nl | grep 10000
>>>
>>> if it shows something means hive server is already running. the second
>>> error comes only when the port you are specifying is already acquired by
>>> some other proces, by default server port is 10000 so very with the above
>>> netstat command which i said.
>>>
>>> Note : suppose you have connected using code exit from ... bin/hive
>>>  of if you are connected through bin/hive > then code will not connect
>>> because i think (not sure) only one client can connect to the hive server.
>>>
>>> do above steps hopefully will solve your problem.
>>>
>>>
>>> Regards
>>>
>>> ∞
>>> Shashwat Shriparv
>>>
>>>
>>>
>>> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com> wrote:
>>>
>>>> Hi Bhavesh,
>>>> You will have to check your Jobtracker logs for more details. If you
>>>> are using AWS, they should be in your S3 logs directory under
>>>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>>>
>>>> Mark
>>>>
>>>> Mark Grover, Business Intelligence Analyst
>>>> OANDA Corporation
>>>>
>>>> www: oanda.com www: fxtrade.com
>>>>
>>>> ----- Original Message -----
>>>> From: "Bhavesh Shah" <bh...@gmail.com>
>>>> To: user@hive.apache.org, dev@hive.apache.org
>>>> Sent: Thursday, May 10, 2012 6:27:28 AM
>>>> Subject: hive failed execution error return code 2 from
>>>> org.apache.hadoop.hive.ql.exec.mapredtask
>>>>
>>>> Hello all,
>>>> I have one query. It is executing fine on Hive CLI and returning the
>>>> result.
>>>> But when I am executing it with the help Hive JDBC I am getting error
>>>> as:
>>>>
>>>> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>>>> Execution Error, return code 2 from
>>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>>> at
>>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>>>
>>>> What is the problem? Also I am starting the Hive Thrift Server through
>>>> Shell Script. (I have written a shell script which has commad to start Hive
>>>> Thrift Server)
>>>> Later I decided to start Hive thrift Server manually by typing command
>>>> as:
>>>>
>>>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>>>> Starting Hive Thrift Server
>>>> org.apache.thrift.transport.TTransportException: Could not create
>>>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>>>> at
>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>>>> at
>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>>>> at
>>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>>>> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>>>> hadoop@ubuntu:~/hive-0.7.1$
>>>>
>>>> Please help me out from this.
>>>> Thanks
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Bhavesh Shah
>>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> ∞
>>> Shashwat Shriparv
>>>
>>>
>>>
>>
>>
>> --
>>
>>
>> ∞
>> Shashwat Shriparv
>>
>>
>>
>
>
> --
> Regards,
> Bhavesh Shah
>
>


-- 


∞
Shashwat Shriparv

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Bhavesh Shah <bh...@gmail.com>.
I perform all this above steps and whenI tried to run in eclipse I got
error.
The error as:

*java.sql.SQLException: Method not supported
    at
org.apache.hadoop.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:210)
    at TestSP.quarterTable(TestSP.java:598)
    at TestSP.main(TestSP.java:73)
*

On Thu, May 10, 2012 at 8:49 PM, shashwat shriparv <
dwivedishashwat@gmail.com> wrote:

> Addition to my last reply ,,, come out from hive cli.. when you are going
> to run your jdbc code. and dont try to connect using cli when your jdbc
> code is running....
>
> Cheers
> Shashwat.
>
>
> On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
> dwivedishashwat@gmail.com> wrote:
>
>> For this error : "
>> *java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>> Execution Error, return code 2 from
>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>>
>> Go to this link :
>> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>>
>>
>> and add
>>
>> hadoop-0.20-core.jar
>> hive/lib/hive-exec-0.7.1.jar
>> hive/lib/hive-jdbc-0.7.1.jar
>> hive/lib/hive-metastore-0.7.1.jar
>> hive/lib/hive-service-0.7.1.jar
>> hive/lib/libfb303.jar
>> lib/commons-logging-1.0.4.jar
>> slf4j-api-1.6.1.jar
>> slf4j-log4j12-1.6.1.jar
>>
>>
>> to the class path of your project , add this jars from the lib of hadoop
>> and hive, and try the code. and also add the path of hadoop, hive, and
>> hbase(if your are using) lib folder path to the project class path, like
>> you have added the jars.
>>
>> and for the second error you got
>>
>> type
>>
>> netstat -nl | grep 10000
>>
>> if it shows something means hive server is already running. the second
>> error comes only when the port you are specifying is already acquired by
>> some other proces, by default server port is 10000 so very with the above
>> netstat command which i said.
>>
>> Note : suppose you have connected using code exit from ... bin/hive    of
>> if you are connected through bin/hive > then code will not connect because
>> i think (not sure) only one client can connect to the hive server.
>>
>> do above steps hopefully will solve your problem.
>>
>>
>> Regards
>>
>> ∞
>> Shashwat Shriparv
>>
>>
>>
>> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com> wrote:
>>
>>> Hi Bhavesh,
>>> You will have to check your Jobtracker logs for more details. If you are
>>> using AWS, they should be in your S3 logs directory under
>>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>>
>>> Mark
>>>
>>> Mark Grover, Business Intelligence Analyst
>>> OANDA Corporation
>>>
>>> www: oanda.com www: fxtrade.com
>>>
>>> ----- Original Message -----
>>> From: "Bhavesh Shah" <bh...@gmail.com>
>>> To: user@hive.apache.org, dev@hive.apache.org
>>> Sent: Thursday, May 10, 2012 6:27:28 AM
>>> Subject: hive failed execution error return code 2 from
>>> org.apache.hadoop.hive.ql.exec.mapredtask
>>>
>>> Hello all,
>>> I have one query. It is executing fine on Hive CLI and returning the
>>> result.
>>> But when I am executing it with the help Hive JDBC I am getting error as:
>>>
>>> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>>> Execution Error, return code 2 from
>>> org.apache.hadoop.hive.ql.exec.MapRedTask
>>> at
>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>>
>>> What is the problem? Also I am starting the Hive Thrift Server through
>>> Shell Script. (I have written a shell script which has commad to start Hive
>>> Thrift Server)
>>> Later I decided to start Hive thrift Server manually by typing command
>>> as:
>>>
>>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>>> Starting Hive Thrift Server
>>> org.apache.thrift.transport.TTransportException: Could not create
>>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>>> at
>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>>> at
>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>>> at
>>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>>> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>>> hadoop@ubuntu:~/hive-0.7.1$
>>>
>>> Please help me out from this.
>>> Thanks
>>>
>>>
>>> --
>>> Regards,
>>> Bhavesh Shah
>>>
>>
>>
>>
>> --
>>
>>
>> ∞
>> Shashwat Shriparv
>>
>>
>>
>
>
> --
>
>
> ∞
> Shashwat Shriparv
>
>
>


-- 
Regards,
Bhavesh Shah

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by shashwat shriparv <dw...@gmail.com>.
Addition to my last reply ,,, come out from hive cli.. when you are going
to run your jdbc code. and dont try to connect using cli when your jdbc
code is running....

Cheers
Shashwat.

On Thu, May 10, 2012 at 8:39 PM, shashwat shriparv <
dwivedishashwat@gmail.com> wrote:

> For this error : "
> *java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
> Execution Error, return code 2 from
> org.apache.hadoop.hive.ql.exec.MapRedTask
>     at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "
>
> Go to this link :
> http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html
>
>
> and add
>
> hadoop-0.20-core.jar
> hive/lib/hive-exec-0.7.1.jar
> hive/lib/hive-jdbc-0.7.1.jar
> hive/lib/hive-metastore-0.7.1.jar
> hive/lib/hive-service-0.7.1.jar
> hive/lib/libfb303.jar
> lib/commons-logging-1.0.4.jar
> slf4j-api-1.6.1.jar
> slf4j-log4j12-1.6.1.jar
>
>
> to the class path of your project , add this jars from the lib of hadoop
> and hive, and try the code. and also add the path of hadoop, hive, and
> hbase(if your are using) lib folder path to the project class path, like
> you have added the jars.
>
> and for the second error you got
>
> type
>
> netstat -nl | grep 10000
>
> if it shows something means hive server is already running. the second
> error comes only when the port you are specifying is already acquired by
> some other proces, by default server port is 10000 so very with the above
> netstat command which i said.
>
> Note : suppose you have connected using code exit from ... bin/hive    of
> if you are connected through bin/hive > then code will not connect because
> i think (not sure) only one client can connect to the hive server.
>
> do above steps hopefully will solve your problem.
>
>
> Regards
>
> ∞
> Shashwat Shriparv
>
>
>
> On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com> wrote:
>
>> Hi Bhavesh,
>> You will have to check your Jobtracker logs for more details. If you are
>> using AWS, they should be in your S3 logs directory under
>> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>>
>> Mark
>>
>> Mark Grover, Business Intelligence Analyst
>> OANDA Corporation
>>
>> www: oanda.com www: fxtrade.com
>>
>> ----- Original Message -----
>> From: "Bhavesh Shah" <bh...@gmail.com>
>> To: user@hive.apache.org, dev@hive.apache.org
>> Sent: Thursday, May 10, 2012 6:27:28 AM
>> Subject: hive failed execution error return code 2 from
>> org.apache.hadoop.hive.ql.exec.mapredtask
>>
>> Hello all,
>> I have one query. It is executing fine on Hive CLI and returning the
>> result.
>> But when I am executing it with the help Hive JDBC I am getting error as:
>>
>> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
>> Execution Error, return code 2 from
>> org.apache.hadoop.hive.ql.exec.MapRedTask
>> at
>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>>
>> What is the problem? Also I am starting the Hive Thrift Server through
>> Shell Script. (I have written a shell script which has commad to start Hive
>> Thrift Server)
>> Later I decided to start Hive thrift Server manually by typing command as:
>>
>> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
>> Starting Hive Thrift Server
>> org.apache.thrift.transport.TTransportException: Could not create
>> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
>> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
>> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
>> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
>> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
>> hadoop@ubuntu:~/hive-0.7.1$
>>
>> Please help me out from this.
>> Thanks
>>
>>
>> --
>> Regards,
>> Bhavesh Shah
>>
>
>
>
> --
>
>
> ∞
> Shashwat Shriparv
>
>
>


-- 


∞
Shashwat Shriparv

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by shashwat shriparv <dw...@gmail.com>.
For this error : "
*java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
Execution Error, return code 2 from
org.apache.hadoop.hive.ql.exec.MapRedTask
    at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer* "

Go to this link :
http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html


and add

hadoop-0.20-core.jar
hive/lib/hive-exec-0.7.1.jar
hive/lib/hive-jdbc-0.7.1.jar
hive/lib/hive-metastore-0.7.1.jar
hive/lib/hive-service-0.7.1.jar
hive/lib/libfb303.jar
lib/commons-logging-1.0.4.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar


to the class path of your project , add this jars from the lib of hadoop
and hive, and try the code. and also add the path of hadoop, hive, and
hbase(if your are using) lib folder path to the project class path, like
you have added the jars.

and for the second error you got

type

netstat -nl | grep 10000

if it shows something means hive server is already running. the second
error comes only when the port you are specifying is already acquired by
some other proces, by default server port is 10000 so very with the above
netstat command which i said.

Note : suppose you have connected using code exit from ... bin/hive    of
if you are connected through bin/hive > then code will not connect because
i think (not sure) only one client can connect to the hive server.

do above steps hopefully will solve your problem.


Regards

∞
Shashwat Shriparv



On Thu, May 10, 2012 at 7:03 PM, Mark Grover <mg...@oanda.com> wrote:

> Hi Bhavesh,
> You will have to check your Jobtracker logs for more details. If you are
> using AWS, they should be in your S3 logs directory under
> <job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log
>
> Mark
>
> Mark Grover, Business Intelligence Analyst
> OANDA Corporation
>
> www: oanda.com www: fxtrade.com
>
> ----- Original Message -----
> From: "Bhavesh Shah" <bh...@gmail.com>
> To: user@hive.apache.org, dev@hive.apache.org
> Sent: Thursday, May 10, 2012 6:27:28 AM
> Subject: hive failed execution error return code 2 from
> org.apache.hadoop.hive.ql.exec.mapredtask
>
> Hello all,
> I have one query. It is executing fine on Hive CLI and returning the
> result.
> But when I am executing it with the help Hive JDBC I am getting error as:
>
> java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED:
> Execution Error, return code 2 from
> org.apache.hadoop.hive.ql.exec.MapRedTask
> at
> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192)
>
> What is the problem? Also I am starting the Hive Thrift Server through
> Shell Script. (I have written a shell script which has commad to start Hive
> Thrift Server)
> Later I decided to start Hive thrift Server manually by typing command as:
>
> hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver
> Starting Hive Thrift Server
> org.apache.thrift.transport.TTransportException: Could not create
> ServerSocket on address 0.0.0.0/0.0.0.0:10000 .
> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99)
> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80)
> at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73)
> at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
> hadoop@ubuntu:~/hive-0.7.1$
>
> Please help me out from this.
> Thanks
>
>
> --
> Regards,
> Bhavesh Shah
>



-- 


∞
Shashwat Shriparv

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Mark Grover <mg...@oanda.com>.
Hi Bhavesh,
You will have to check your Jobtracker logs for more details. If you are using AWS, they should be in your S3 logs directory under
<job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log

Mark

Mark Grover, Business Intelligence Analyst
OANDA Corporation 

www: oanda.com www: fxtrade.com 

----- Original Message -----
From: "Bhavesh Shah" <bh...@gmail.com>
To: user@hive.apache.org, dev@hive.apache.org
Sent: Thursday, May 10, 2012 6:27:28 AM
Subject: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Hello all, 
I have one query. It is executing fine on Hive CLI and returning the result. 
But when I am executing it with the help Hive JDBC I am getting error as: 

java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask 
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192) 

What is the problem? Also I am starting the Hive Thrift Server through Shell Script. (I have written a shell script which has commad to start Hive Thrift Server) 
Later I decided to start Hive thrift Server manually by typing command as: 

hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver 
Starting Hive Thrift Server 
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000 . 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99) 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80) 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73) 
at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.hadoop.util.RunJar.main(RunJar.java:186) 
hadoop@ubuntu:~/hive-0.7.1$ 

Please help me out from this. 
Thanks 


-- 
Regards, 
Bhavesh Shah 

Re: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Posted by Mark Grover <mg...@oanda.com>.
Hi Bhavesh,
You will have to check your Jobtracker logs for more details. If you are using AWS, they should be in your S3 logs directory under
<job_flow_id>/daemons/<master_node_id>/hadoop-hadoop-jobtracker...log

Mark

Mark Grover, Business Intelligence Analyst
OANDA Corporation 

www: oanda.com www: fxtrade.com 

----- Original Message -----
From: "Bhavesh Shah" <bh...@gmail.com>
To: user@hive.apache.org, dev@hive.apache.org
Sent: Thursday, May 10, 2012 6:27:28 AM
Subject: hive failed execution error return code 2 from org.apache.hadoop.hive.ql.exec.mapredtask

Hello all, 
I have one query. It is executing fine on Hive CLI and returning the result. 
But when I am executing it with the help Hive JDBC I am getting error as: 

java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask 
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:192) 

What is the problem? Also I am starting the Hive Thrift Server through Shell Script. (I have written a shell script which has commad to start Hive Thrift Server) 
Later I decided to start Hive thrift Server manually by typing command as: 

hadoop@ubuntu:~/hive-0.7.1$ bin/hive --service hiveserver 
Starting Hive Thrift Server 
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000 . 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:99) 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:80) 
at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:73) 
at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:384) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.hadoop.util.RunJar.main(RunJar.java:186) 
hadoop@ubuntu:~/hive-0.7.1$ 

Please help me out from this. 
Thanks 


-- 
Regards, 
Bhavesh Shah