Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Strange error working with Hive + JDBC

Strange error working with Hive + JDBC

New Contributor

Hello there. I am struggling with Hive+ jdbc and hope somebody here could help me. 

 

My Hive warehouse contains two simple tables table1 and table2:

TABLE1 (id INT, name STRING), TABLE2 (id INT, score INT)

 

They are already filled by some data and a simple join command executed in hive console works properly:


hive> select * from  table1, table2 where table1.id=table2.id;

 

OK
3       Anton   3       18
1       Alexander       1       14
3       Anton   3       6
4       Marina  4       15


Strange things happen when I try to launch the same query via jdbc (1.1.0 version):

 

public void makeJoinInHive() throws SQLException {
String selectQuery1 = "SELECT * from table1, table2 where" +
" table1.id=table2.id" ;
statement.execute(selectQuery1);
statement.close();
}

I got the error:

Exception in thread "main" java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 127 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
        at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:296)
        at hivedemo.HiveJDBCClient.makeJoinInHive(HiveJDBCClient.java:67)
        at hivedemo.HiveJDBCClient.main(HiveJDBCClient.java:47)

 

I omitted the part where I initialize connection and launch the method above because there are no problems with connection and simple one-table-select queries are completed successfully.

 

 

 

1 REPLY 1
Highlighted

Re: Strange error working with Hive + JDBC

Contributor

This error indicates that it failed to spawn a child process to do the mapjoin (MapredLocalTask).

 

These can be a little hard to debug, make sure you dont have any settings that would cause the child process to not be able to spawn as it picks up the variables from the parent.  For example, if you have any java flags for remote debugging, etc.