Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiveserver2 cannot fetch result of a query from remote connection

Hi I am facing a problem while trying to fetch data from a remote hadoop cluster using hiveserver2.

The JDBC connection is working in the sense that meta data queries such as show tables is working and even the queries that require simple listing of data such as select * from table is also working.But when a query,that causes a map-reduce job on hadoop,is execute such as select count(*) from table then it throws a connection exception.I can see in the hive logs that the query is executed without any error.

I tried the same thing with beeline and it worked when i connected using localhost but when I connected using server name the execution just hung.

I am sure I have some configuration property that is causing this problem.

I am using hadoop version 2.0 and Hive version 0.12.0

Just for the sake of clarity the error thrown at the client side is as follows

Exception in thread "main" java.sql.SQLException:   org.apache.thrift.transport.TTransportException
at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:203)
at org.apache.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:300)
at com.nanobi.contentserver.Aatest.HiveJdbcClient.main(HiveJdbcClient.java:57)

Like I said there is no error on the server or hive.log and query is executed successfully. Best guess is that error is thrown while fetching the result of the query.Can`t find exactly where though.

Please let me know if further clarification is required to understand the problem

Thanks in advance

like image 530
tyagi Avatar asked Apr 17 '14 11:04

tyagi


1 Answers

Since you are able to fetch data it means your connection with have works fine. Start the hive server again, and check.

If this does'nt work check your hadoop configuration properties.

As you said, "I tried the same thing with beeline and it worked when i connected using localhost but when I connected using server name the execution just hung.", Check whether the Host name is being reflected or not.

Where are you using the JDBC connection to connect to hive server?

like image 86
Shailvi Avatar answered Oct 11 '22 05:10

Shailvi