Support Questions
Find answers, ask questions, and share your expertise

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;


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" +
"" ;

I got the error:

Exception in thread "main" java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 127 from
        at org.apache.hive.jdbc.HiveStatement.execute(
        at hivedemo.HiveJDBCClient.makeJoinInHive(
        at hivedemo.HiveJDBCClient.main(


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.






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.