You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Dave Cardwell <da...@davecardwell.co.uk> on 2013/05/14 12:35:31 UTC

hiveserver2 Thrift Interface With Perl

I wrote a few reporting scripts in Perl that connected to Hive via the
Thrift interface.

Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
0.10.0) the scripts no longer ran due to the API changes.

I regenerated the Perl modules from the .thrift files and have tried to
translate the Java examples I’ve found online, but cannot for the life of
me get it working with the new interface.

The Java examples seem to use a TOpenSessionReq class but I cannot find
this anywhere in the generated Perl modules. If I try to skip that part and
go straight to $client->OpenSession() without an argument, the TCLIService
module itself complains that it cannot create a TOpenSessionResp object
because the class is not loaded.

I have attached example code. Can anyone advise me on how to get past this
block?

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
I just wanted to update the list to let future searchers know that I found
a solution—David Morel of booking.com kindly shared some code with me to
get this working, which he has now released as a Perl library that has been
working well:

https://github.com/dmorel/Thrift-API-HiveClient2
https://metacpan.org/release/Thrift-API-HiveClient2

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 14 May 2013 11:35, Dave Cardwell <da...@davecardwell.co.uk> wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
Hi guys,

I had already used the NOSASL setting to turn off that authentication, so
was able to connect to the cluster fine.

My issue is with how to use the new API to execute a query and get the
response.


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 15 May 2013 00:05, Carl Steinbach <cw...@gmail.com> wrote:

> This SASL module for Perl may be of interest:
>
> http://search.cpan.org/~gbarr/Authen-SASL-2.16/
>
>
>
> On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:
>
>>
>>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
>> doesn't support sasl transport for perl. In order to connect from a perl
>> thrift client, you need to turn off the SASL in HiveServer2. This can be
>> done by setting a property hive.server2.authentication to NOSASL in the
>> hive-site.xml. Note that with this change, all other clients like JDBC
>> applications and beeline, will also need to make non-sasl connection to
>> HiveServer2. The JDBC connection URL should
>> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>>
>> thanks
>> Prasad
>>
>>
>> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>>
>>> I wrote a few reporting scripts in Perl that connected to Hive via the
>>> Thrift interface.
>>>
>>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>>> 0.10.0) the scripts no longer ran due to the API changes.
>>>
>>> I regenerated the Perl modules from the .thrift files and have tried to
>>> translate the Java examples I’ve found online, but cannot for the life of
>>> me get it working with the new interface.
>>>
>>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>>> this anywhere in the generated Perl modules. If I try to skip that part and
>>> go straight to $client->OpenSession() without an argument, the TCLIService
>>> module itself complains that it cannot create a TOpenSessionResp object
>>> because the class is not loaded.
>>>
>>> I have attached example code. Can anyone advise me on how to get past
>>> this block?
>>>
>>> --
>>> Best wishes,
>>> Dave Cardwell.
>>>
>>> http://davecardwell.co.uk/
>>>
>>
>>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
Hi guys,

I had already used the NOSASL setting to turn off that authentication, so
was able to connect to the cluster fine.

My issue is with how to use the new API to execute a query and get the
response.


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 15 May 2013 00:05, Carl Steinbach <cw...@gmail.com> wrote:

> This SASL module for Perl may be of interest:
>
> http://search.cpan.org/~gbarr/Authen-SASL-2.16/
>
>
>
> On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:
>
>>
>>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
>> doesn't support sasl transport for perl. In order to connect from a perl
>> thrift client, you need to turn off the SASL in HiveServer2. This can be
>> done by setting a property hive.server2.authentication to NOSASL in the
>> hive-site.xml. Note that with this change, all other clients like JDBC
>> applications and beeline, will also need to make non-sasl connection to
>> HiveServer2. The JDBC connection URL should
>> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>>
>> thanks
>> Prasad
>>
>>
>> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>>
>>> I wrote a few reporting scripts in Perl that connected to Hive via the
>>> Thrift interface.
>>>
>>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>>> 0.10.0) the scripts no longer ran due to the API changes.
>>>
>>> I regenerated the Perl modules from the .thrift files and have tried to
>>> translate the Java examples I’ve found online, but cannot for the life of
>>> me get it working with the new interface.
>>>
>>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>>> this anywhere in the generated Perl modules. If I try to skip that part and
>>> go straight to $client->OpenSession() without an argument, the TCLIService
>>> module itself complains that it cannot create a TOpenSessionResp object
>>> because the class is not loaded.
>>>
>>> I have attached example code. Can anyone advise me on how to get past
>>> this block?
>>>
>>> --
>>> Best wishes,
>>> Dave Cardwell.
>>>
>>> http://davecardwell.co.uk/
>>>
>>
>>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
Hi guys,

I had already used the NOSASL setting to turn off that authentication, so
was able to connect to the cluster fine.

My issue is with how to use the new API to execute a query and get the
response.


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 15 May 2013 00:05, Carl Steinbach <cw...@gmail.com> wrote:

> This SASL module for Perl may be of interest:
>
> http://search.cpan.org/~gbarr/Authen-SASL-2.16/
>
>
>
> On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:
>
>>
>>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
>> doesn't support sasl transport for perl. In order to connect from a perl
>> thrift client, you need to turn off the SASL in HiveServer2. This can be
>> done by setting a property hive.server2.authentication to NOSASL in the
>> hive-site.xml. Note that with this change, all other clients like JDBC
>> applications and beeline, will also need to make non-sasl connection to
>> HiveServer2. The JDBC connection URL should
>> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>>
>> thanks
>> Prasad
>>
>>
>> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>>
>>> I wrote a few reporting scripts in Perl that connected to Hive via the
>>> Thrift interface.
>>>
>>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>>> 0.10.0) the scripts no longer ran due to the API changes.
>>>
>>> I regenerated the Perl modules from the .thrift files and have tried to
>>> translate the Java examples I’ve found online, but cannot for the life of
>>> me get it working with the new interface.
>>>
>>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>>> this anywhere in the generated Perl modules. If I try to skip that part and
>>> go straight to $client->OpenSession() without an argument, the TCLIService
>>> module itself complains that it cannot create a TOpenSessionResp object
>>> because the class is not loaded.
>>>
>>> I have attached example code. Can anyone advise me on how to get past
>>> this block?
>>>
>>> --
>>> Best wishes,
>>> Dave Cardwell.
>>>
>>> http://davecardwell.co.uk/
>>>
>>
>>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
Hi guys,

I had already used the NOSASL setting to turn off that authentication, so
was able to connect to the cluster fine.

My issue is with how to use the new API to execute a query and get the
response.


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 15 May 2013 00:05, Carl Steinbach <cw...@gmail.com> wrote:

> This SASL module for Perl may be of interest:
>
> http://search.cpan.org/~gbarr/Authen-SASL-2.16/
>
>
>
> On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:
>
>>
>>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
>> doesn't support sasl transport for perl. In order to connect from a perl
>> thrift client, you need to turn off the SASL in HiveServer2. This can be
>> done by setting a property hive.server2.authentication to NOSASL in the
>> hive-site.xml. Note that with this change, all other clients like JDBC
>> applications and beeline, will also need to make non-sasl connection to
>> HiveServer2. The JDBC connection URL should
>> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>>
>> thanks
>> Prasad
>>
>>
>> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>>
>>> I wrote a few reporting scripts in Perl that connected to Hive via the
>>> Thrift interface.
>>>
>>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>>> 0.10.0) the scripts no longer ran due to the API changes.
>>>
>>> I regenerated the Perl modules from the .thrift files and have tried to
>>> translate the Java examples I’ve found online, but cannot for the life of
>>> me get it working with the new interface.
>>>
>>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>>> this anywhere in the generated Perl modules. If I try to skip that part and
>>> go straight to $client->OpenSession() without an argument, the TCLIService
>>> module itself complains that it cannot create a TOpenSessionResp object
>>> because the class is not loaded.
>>>
>>> I have attached example code. Can anyone advise me on how to get past
>>> this block?
>>>
>>> --
>>> Best wishes,
>>> Dave Cardwell.
>>>
>>> http://davecardwell.co.uk/
>>>
>>
>>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
Hi guys,

I had already used the NOSASL setting to turn off that authentication, so
was able to connect to the cluster fine.

My issue is with how to use the new API to execute a query and get the
response.


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 15 May 2013 00:05, Carl Steinbach <cw...@gmail.com> wrote:

> This SASL module for Perl may be of interest:
>
> http://search.cpan.org/~gbarr/Authen-SASL-2.16/
>
>
>
> On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:
>
>>
>>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
>> doesn't support sasl transport for perl. In order to connect from a perl
>> thrift client, you need to turn off the SASL in HiveServer2. This can be
>> done by setting a property hive.server2.authentication to NOSASL in the
>> hive-site.xml. Note that with this change, all other clients like JDBC
>> applications and beeline, will also need to make non-sasl connection to
>> HiveServer2. The JDBC connection URL should
>> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>>
>> thanks
>> Prasad
>>
>>
>> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>>
>>> I wrote a few reporting scripts in Perl that connected to Hive via the
>>> Thrift interface.
>>>
>>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>>> 0.10.0) the scripts no longer ran due to the API changes.
>>>
>>> I regenerated the Perl modules from the .thrift files and have tried to
>>> translate the Java examples I’ve found online, but cannot for the life of
>>> me get it working with the new interface.
>>>
>>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>>> this anywhere in the generated Perl modules. If I try to skip that part and
>>> go straight to $client->OpenSession() without an argument, the TCLIService
>>> module itself complains that it cannot create a TOpenSessionResp object
>>> because the class is not loaded.
>>>
>>> I have attached example code. Can anyone advise me on how to get past
>>> this block?
>>>
>>> --
>>> Best wishes,
>>> Dave Cardwell.
>>>
>>> http://davecardwell.co.uk/
>>>
>>
>>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Carl Steinbach <cw...@gmail.com>.
This SASL module for Perl may be of interest:

http://search.cpan.org/~gbarr/Authen-SASL-2.16/



On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:

>
>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
> doesn't support sasl transport for perl. In order to connect from a perl
> thrift client, you need to turn off the SASL in HiveServer2. This can be
> done by setting a property hive.server2.authentication to NOSASL in the
> hive-site.xml. Note that with this change, all other clients like JDBC
> applications and beeline, will also need to make non-sasl connection to
> HiveServer2. The JDBC connection URL should
> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>
> thanks
> Prasad
>
>
> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>
>> I wrote a few reporting scripts in Perl that connected to Hive via the
>> Thrift interface.
>>
>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>> 0.10.0) the scripts no longer ran due to the API changes.
>>
>> I regenerated the Perl modules from the .thrift files and have tried to
>> translate the Java examples I’ve found online, but cannot for the life of
>> me get it working with the new interface.
>>
>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>> this anywhere in the generated Perl modules. If I try to skip that part and
>> go straight to $client->OpenSession() without an argument, the TCLIService
>> module itself complains that it cannot create a TOpenSessionResp object
>> because the class is not loaded.
>>
>> I have attached example code. Can anyone advise me on how to get past
>> this block?
>>
>> --
>> Best wishes,
>> Dave Cardwell.
>>
>> http://davecardwell.co.uk/
>>
>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Carl Steinbach <cw...@gmail.com>.
This SASL module for Perl may be of interest:

http://search.cpan.org/~gbarr/Authen-SASL-2.16/



On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:

>
>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
> doesn't support sasl transport for perl. In order to connect from a perl
> thrift client, you need to turn off the SASL in HiveServer2. This can be
> done by setting a property hive.server2.authentication to NOSASL in the
> hive-site.xml. Note that with this change, all other clients like JDBC
> applications and beeline, will also need to make non-sasl connection to
> HiveServer2. The JDBC connection URL should
> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>
> thanks
> Prasad
>
>
> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>
>> I wrote a few reporting scripts in Perl that connected to Hive via the
>> Thrift interface.
>>
>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>> 0.10.0) the scripts no longer ran due to the API changes.
>>
>> I regenerated the Perl modules from the .thrift files and have tried to
>> translate the Java examples I’ve found online, but cannot for the life of
>> me get it working with the new interface.
>>
>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>> this anywhere in the generated Perl modules. If I try to skip that part and
>> go straight to $client->OpenSession() without an argument, the TCLIService
>> module itself complains that it cannot create a TOpenSessionResp object
>> because the class is not loaded.
>>
>> I have attached example code. Can anyone advise me on how to get past
>> this block?
>>
>> --
>> Best wishes,
>> Dave Cardwell.
>>
>> http://davecardwell.co.uk/
>>
>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Carl Steinbach <cw...@gmail.com>.
This SASL module for Perl may be of interest:

http://search.cpan.org/~gbarr/Authen-SASL-2.16/



On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:

>
>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
> doesn't support sasl transport for perl. In order to connect from a perl
> thrift client, you need to turn off the SASL in HiveServer2. This can be
> done by setting a property hive.server2.authentication to NOSASL in the
> hive-site.xml. Note that with this change, all other clients like JDBC
> applications and beeline, will also need to make non-sasl connection to
> HiveServer2. The JDBC connection URL should
> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>
> thanks
> Prasad
>
>
> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>
>> I wrote a few reporting scripts in Perl that connected to Hive via the
>> Thrift interface.
>>
>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>> 0.10.0) the scripts no longer ran due to the API changes.
>>
>> I regenerated the Perl modules from the .thrift files and have tried to
>> translate the Java examples I’ve found online, but cannot for the life of
>> me get it working with the new interface.
>>
>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>> this anywhere in the generated Perl modules. If I try to skip that part and
>> go straight to $client->OpenSession() without an argument, the TCLIService
>> module itself complains that it cannot create a TOpenSessionResp object
>> because the class is not loaded.
>>
>> I have attached example code. Can anyone advise me on how to get past
>> this block?
>>
>> --
>> Best wishes,
>> Dave Cardwell.
>>
>> http://davecardwell.co.uk/
>>
>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Carl Steinbach <cw...@gmail.com>.
This SASL module for Perl may be of interest:

http://search.cpan.org/~gbarr/Authen-SASL-2.16/



On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:

>
>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
> doesn't support sasl transport for perl. In order to connect from a perl
> thrift client, you need to turn off the SASL in HiveServer2. This can be
> done by setting a property hive.server2.authentication to NOSASL in the
> hive-site.xml. Note that with this change, all other clients like JDBC
> applications and beeline, will also need to make non-sasl connection to
> HiveServer2. The JDBC connection URL should
> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>
> thanks
> Prasad
>
>
> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>
>> I wrote a few reporting scripts in Perl that connected to Hive via the
>> Thrift interface.
>>
>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>> 0.10.0) the scripts no longer ran due to the API changes.
>>
>> I regenerated the Perl modules from the .thrift files and have tried to
>> translate the Java examples I’ve found online, but cannot for the life of
>> me get it working with the new interface.
>>
>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>> this anywhere in the generated Perl modules. If I try to skip that part and
>> go straight to $client->OpenSession() without an argument, the TCLIService
>> module itself complains that it cannot create a TOpenSessionResp object
>> because the class is not loaded.
>>
>> I have attached example code. Can anyone advise me on how to get past
>> this block?
>>
>> --
>> Best wishes,
>> Dave Cardwell.
>>
>> http://davecardwell.co.uk/
>>
>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Carl Steinbach <cw...@gmail.com>.
This SASL module for Perl may be of interest:

http://search.cpan.org/~gbarr/Authen-SASL-2.16/



On Tue, May 14, 2013 at 9:44 AM, Prasad Mujumdar <pr...@cloudera.com>wrote:

>
>    HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift
> doesn't support sasl transport for perl. In order to connect from a perl
> thrift client, you need to turn off the SASL in HiveServer2. This can be
> done by setting a property hive.server2.authentication to NOSASL in the
> hive-site.xml. Note that with this change, all other clients like JDBC
> applications and beeline, will also need to make non-sasl connection to
> HiveServer2. The JDBC connection URL should
> be jdbc:hive2://<host>:<port>/default;auth=noSasl
>
> thanks
> Prasad
>
>
> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:
>
>> I wrote a few reporting scripts in Perl that connected to Hive via the
>> Thrift interface.
>>
>> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
>> 0.10.0) the scripts no longer ran due to the API changes.
>>
>> I regenerated the Perl modules from the .thrift files and have tried to
>> translate the Java examples I’ve found online, but cannot for the life of
>> me get it working with the new interface.
>>
>> The Java examples seem to use a TOpenSessionReq class but I cannot find
>> this anywhere in the generated Perl modules. If I try to skip that part and
>> go straight to $client->OpenSession() without an argument, the TCLIService
>> module itself complains that it cannot create a TOpenSessionResp object
>> because the class is not loaded.
>>
>> I have attached example code. Can anyone advise me on how to get past
>> this block?
>>
>> --
>> Best wishes,
>> Dave Cardwell.
>>
>> http://davecardwell.co.uk/
>>
>
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Prasad Mujumdar <pr...@cloudera.com>.
   HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift doesn't
support sasl transport for perl. In order to connect from a perl thrift
client, you need to turn off the SASL in HiveServer2. This can be done by
setting a property hive.server2.authentication to NOSASL in the
hive-site.xml. Note that with this change, all other clients like JDBC
applications and beeline, will also need to make non-sasl connection to
HiveServer2. The JDBC connection URL should
be jdbc:hive2://<host>:<port>/default;auth=noSasl

thanks
Prasad

On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Prasad Mujumdar <pr...@cloudera.com>.
   HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift doesn't
support sasl transport for perl. In order to connect from a perl thrift
client, you need to turn off the SASL in HiveServer2. This can be done by
setting a property hive.server2.authentication to NOSASL in the
hive-site.xml. Note that with this change, all other clients like JDBC
applications and beeline, will also need to make non-sasl connection to
HiveServer2. The JDBC connection URL should
be jdbc:hive2://<host>:<port>/default;auth=noSasl

thanks
Prasad

On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Prasad Mujumdar <pr...@cloudera.com>.
   HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift doesn't
support sasl transport for perl. In order to connect from a perl thrift
client, you need to turn off the SASL in HiveServer2. This can be done by
setting a property hive.server2.authentication to NOSASL in the
hive-site.xml. Note that with this change, all other clients like JDBC
applications and beeline, will also need to make non-sasl connection to
HiveServer2. The JDBC connection URL should
be jdbc:hive2://<host>:<port>/default;auth=noSasl

thanks
Prasad

On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
I just wanted to update the list to let future searchers know that I found
a solution—David Morel of booking.com kindly shared some code with me to
get this working, which he has now released as a Perl library that has been
working well:

https://github.com/dmorel/Thrift-API-HiveClient2
https://metacpan.org/release/Thrift-API-HiveClient2

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 14 May 2013 11:35, Dave Cardwell <da...@davecardwell.co.uk> wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Prasad Mujumdar <pr...@cloudera.com>.
   HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift doesn't
support sasl transport for perl. In order to connect from a perl thrift
client, you need to turn off the SASL in HiveServer2. This can be done by
setting a property hive.server2.authentication to NOSASL in the
hive-site.xml. Note that with this change, all other clients like JDBC
applications and beeline, will also need to make non-sasl connection to
HiveServer2. The JDBC connection URL should
be jdbc:hive2://<host>:<port>/default;auth=noSasl

thanks
Prasad

On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
I just wanted to update the list to let future searchers know that I found
a solution—David Morel of booking.com kindly shared some code with me to
get this working, which he has now released as a Perl library that has been
working well:

https://github.com/dmorel/Thrift-API-HiveClient2
https://metacpan.org/release/Thrift-API-HiveClient2

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 14 May 2013 11:35, Dave Cardwell <da...@davecardwell.co.uk> wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Prasad Mujumdar <pr...@cloudera.com>.
   HiveServer2 uses Thrift SASL transport by default. AFAIK, Thrift doesn't
support sasl transport for perl. In order to connect from a perl thrift
client, you need to turn off the SASL in HiveServer2. This can be done by
setting a property hive.server2.authentication to NOSASL in the
hive-site.xml. Note that with this change, all other clients like JDBC
applications and beeline, will also need to make non-sasl connection to
HiveServer2. The JDBC connection URL should
be jdbc:hive2://<host>:<port>/default;auth=noSasl

thanks
Prasad

On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell <da...@davecardwell.co.uk>wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
I just wanted to update the list to let future searchers know that I found
a solution—David Morel of booking.com kindly shared some code with me to
get this working, which he has now released as a Perl library that has been
working well:

https://github.com/dmorel/Thrift-API-HiveClient2
https://metacpan.org/release/Thrift-API-HiveClient2

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 14 May 2013 11:35, Dave Cardwell <da...@davecardwell.co.uk> wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>

Re: hiveserver2 Thrift Interface With Perl

Posted by Dave Cardwell <da...@davecardwell.co.uk>.
I just wanted to update the list to let future searchers know that I found
a solution—David Morel of booking.com kindly shared some code with me to
get this working, which he has now released as a Perl library that has been
working well:

https://github.com/dmorel/Thrift-API-HiveClient2
https://metacpan.org/release/Thrift-API-HiveClient2

-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/


On 14 May 2013 11:35, Dave Cardwell <da...@davecardwell.co.uk> wrote:

> I wrote a few reporting scripts in Perl that connected to Hive via the
> Thrift interface.
>
> Since we upgraded CDH to 4.2.0 and hiveserver2 was installed (with Hive
> 0.10.0) the scripts no longer ran due to the API changes.
>
> I regenerated the Perl modules from the .thrift files and have tried to
> translate the Java examples I’ve found online, but cannot for the life of
> me get it working with the new interface.
>
> The Java examples seem to use a TOpenSessionReq class but I cannot find
> this anywhere in the generated Perl modules. If I try to skip that part and
> go straight to $client->OpenSession() without an argument, the TCLIService
> module itself complains that it cannot create a TOpenSessionResp object
> because the class is not loaded.
>
> I have attached example code. Can anyone advise me on how to get past this
> block?
>
> --
> Best wishes,
> Dave Cardwell.
>
> http://davecardwell.co.uk/
>