You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Saptarshi Guha <sa...@revolution-computing.com> on 2010/12/01 01:51:35 UTC

Deserializing results from ThriftHiveClient::fetch*

Hello 

A few questions. Once i get the result from e.g   void fetchOne(std::string& _return);
how does one parse the bytes in _return?

Is this what getSchema is for? Do I call getSchema, figure out the column types
and (somehow) deserialize? Or are there functions for to deserialize this?
The source does say something about Thrift serialized form, so maybe there could
thrift functions to deserialize the return values from fetch*.

Once again thanks for your pointers

Cheers
Joy


Re: Deserializing results from ThriftHiveClient::fetch*

Posted by Saptarshi Guha <sa...@revolution-computing.com>.
Hi Carl,

I had played around with the HBase thrift api and it was a matter of generating the cpp files and using them.
I assumed Hive thrift would be something similar - hence my messing around with that.

But you correctly guessed my intentions : a c++ client. So i'll concentrate on hiveclient.

Thanks
J

From: Carl Steinbach <ca...@cloudera.com>
Date: November 30, 2010 9:00:16 PM PST
To: user@hive.apache.org
Subject: Re: Deserializing results from ThriftHiveClient::fetch*
Reply-To: user@hive.apache.org



> Hi Joy,
> 
> I'm not sure what you're trying to accomplish (maybe you can provide some more details?),
> but assuming that your goal is to access Hive via a C++ Thrift client, then I strongly recommend
> that you use the hiveclient wrapper code located in odbc/src/cpp instead of messing around
> with the raw code generated by the Thrift compiler. Documentation for the C++ Hive client library
> is located in the header file (odbc/src/cpp/hiveclient.h).
> 
> However, if you really do want to access the C++ Thrift API directly, then you should look at the
> implementation of the hiveclient library for examples of how to unmarshall the results returned by
> fetchOne().
> 
> Thanks.
> 
> Carl
> 
> On Tue, Nov 30, 2010 at 4:51 PM, Saptarshi Guha <sa...@revolution-computing.com> wrote:
> Hello
> 
> A few questions. Once i get the result from e.g   void fetchOne(std::string& _return);
> how does one parse the bytes in _return?
> 
> Is this what getSchema is for? Do I call getSchema, figure out the column types
> and (somehow) deserialize? Or are there functions for to deserialize this?
> The source does say something about Thrift serialized form, so maybe there could
> thrift functions to deserialize the return values from fetch*.
> 
> Once again thanks for your pointers
> 
> Cheers
> Joy
> 
> 


Re: Deserializing results from ThriftHiveClient::fetch*

Posted by Carl Steinbach <ca...@cloudera.com>.
Hi Joy,

I'm not sure what you're trying to accomplish (maybe you can provide some
more details?),
but assuming that your goal is to access Hive via a C++ Thrift client, then
I strongly recommend
that you use the hiveclient wrapper code located in odbc/src/cpp instead of
messing around
with the raw code generated by the Thrift compiler. Documentation for the
C++ Hive client library
is located in the header file (odbc/src/cpp/hiveclient.h).

However, if you really do want to access the C++ Thrift API directly, then
you should look at the
implementation of the hiveclient library for examples of how to unmarshall
the results returned by
fetchOne().

Thanks.

Carl

On Tue, Nov 30, 2010 at 4:51 PM, Saptarshi Guha <
saptarshi@revolution-computing.com> wrote:

> Hello
>
> A few questions. Once i get the result from e.g   void
> fetchOne(std::string& _return);
> how does one parse the bytes in _return?
>
> Is this what getSchema is for? Do I call getSchema, figure out the column
> types
> and (somehow) deserialize? Or are there functions for to deserialize this?
> The source does say something about Thrift serialized form, so maybe there
> could
> thrift functions to deserialize the return values from fetch*.
>
> Once again thanks for your pointers
>
> Cheers
> Joy
>
>

Re: Deserializing results from ThriftHiveClient::fetch*

Posted by Saptarshi Guha <sa...@revolution-computing.com>.
And sorry for the terrible grammar. Should have proofread.
Cheers
J
From: Saptarshi Guha <sa...@revolution-computing.com>
Date: November 30, 2010 4:51:35 PM PST
To: user@hive.apache.org
Subject: Deserializing results from ThriftHiveClient::fetch*




> Hello 
> 
> A few questions. Once i get the result from e.g   void fetchOne(std::string& _return);
> how does one parse the bytes in _return?
> 
> Is this what getSchema is for? Do I call getSchema, figure out the column types
> and (somehow) deserialize? Or are there functions for to deserialize this?
> The source does say something about Thrift serialized form, so maybe there could
> thrift functions to deserialize the return values from fetch*.
> 
> Once again thanks for your pointers
> 
> Cheers
> Joy
>