hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Haroon Muhammad <muhammad.har...@live.com>
Subject RE: HS2 ODBC incompatibility
Date Tue, 22 Oct 2013 17:47:14 GMT

Looking at some of the sample code in java implementation, can't figure out where I am going
wrong. Is it possible to point out what is that I am doing wrong here ? It executes the select
query fine at the server end ( looking at the logs), however, fetchRes->results.rows.size()
turns out to be zero.
// quer_str = "SELECT * FROM foo";
	TOpenSessionReq *sessionReq = new TOpenSessionReq();
	sessionReq->__set_client_protocol((TProtocolVersion::type)0);

	TOpenSessionResp *sessionRes = new TOpenSessionResp();
	//TSessionHandle *sessionHandle = new TSessionHandle();

	connection->client->OpenSession(*sessionRes, *sessionReq);

	TExecuteStatementReq *execStmtReq = new TExecuteStatementReq();
	TExecuteStatementResp *execStmtRes = new TExecuteStatementResp();
        execStmtReq->__set_sessionHandle(sessionRes->sessionHandle);
	execStmtReq->__set_statement(query_str);


	connection->client->ExecuteStatement(*execStmtRes, *execStmtReq);


	TFetchResultsReq *fetchReq = new TFetchResultsReq();
	fetchReq->__set_operationHandle(execStmtRes->operationHandle);
	fetchReq->__set_orientation((TFetchOrientation::type)4);

	TFetchResultsResp *fetchRes = new TFetchResultsResp();
	connection->client->FetchResults(*fetchRes, *fetchReq);
	std::vector<TRow> vRow = fetchRes->results.rows;
	cout<<"Row size:" << vRow.size() <<endl;


Thanks,Date: Tue, 22 Oct 2013 09:53:18 -0700
Subject: Re: HS2 ODBC incompatibility
From: prasadm@cloudera.com
To: user@hive.apache.org


   The Apache Hive JDBC driver (https://github.com/apache/hive/tree/trunk/jdbc/src/java/org/apache/hive/jdbc)
is Java implementation of thrift client for HS2.

thanksPrasad


On Tue, Oct 22, 2013 at 7:04 AM, Haroon Muhammad <muhammad.haroon@live.com> wrote:




Thanks Carl and Tejas!!
Actually my application ( written in C) is based on the ODBC source i.e. makes use of ODBC
client source files. It works fine for Hiveserver1 but fails with Hiveserver2 for obvious
reasons. I am trying to incorporate TCLIService now and facing issue with "FetchResults" i.e.
TFetchResultsResp->results.rows.size() is always zero (I am doing a SELECT which should
return 10k rows in my table).

Would it be possible to share/point to a working thrift client (any language) sample code
for HiveServer2? It would help me verify the steps I am doing.
Thanks
Date: Mon, 21 Oct 2013 12:11:27 -0700
Subject: Re: HS2 ODBC incompatibility
From: cwsteinbach@gmail.com
To: user@hive.apache.org


Cloudera has an ODBC driver that is compatible with both HiveServer1 and HiveServer2. More
info here:
http://www.cloudera.com/content/cloudera-content/cloudera-docs/Connectors/PDF/Cloudera-ODBC-Driver-for-Apache-Hive-Install-Guide.pdf



Thanks.
Carl

On Mon, Oct 21, 2013 at 12:01 PM, Thejas Nair <thejas@hortonworks.com> wrote:


Yes, the current odbc driver source in hive is not compatible with

hive server2. I am not aware of any body working on it.

But you can download odbc driver add on for hive server2, for free

from the hortonworks website -

http://hortonworks.com/download/download-archives/



On Mon, Oct 21, 2013 at 5:06 AM, Haroon Muhammad

<muhammad.haroon@live.com> wrote:

> Hi,

>

> Source under ODBC seems to be incompatible with HS2's changed RPC thrift

> interface. Are there any plans on getting an updated version out any time

> sooner ?

>

> Thanks,



--

CONFIDENTIALITY NOTICE

NOTICE: This message is intended for the use of the individual or entity to

which it is addressed and may contain information that is confidential,

privileged and exempt from disclosure under applicable law. If the reader

of this message is not the intended recipient, you are hereby notified that

any printing, copying, dissemination, distribution, disclosure or

forwarding of this communication is strictly prohibited. If you have

received this communication in error, please contact the sender immediately

and delete it from your system. Thank You.


 		 	   		  

 		 	   		  
Mime
View raw message