Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB74BD1DB for ; Wed, 15 May 2013 09:21:09 +0000 (UTC) Received: (qmail 79139 invoked by uid 500); 15 May 2013 09:21:07 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 75422 invoked by uid 500); 15 May 2013 09:21:02 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 74838 invoked by uid 99); 15 May 2013 09:21:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 May 2013 09:21:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dave@davecardwell.co.uk designates 209.85.192.175 as permitted sender) Received: from [209.85.192.175] (HELO mail-pd0-f175.google.com) (209.85.192.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 May 2013 09:20:56 +0000 Received: by mail-pd0-f175.google.com with SMTP id y14so1198790pdi.34 for ; Wed, 15 May 2013 02:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davecardwell.co.uk; s=google; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=DDW96zRIMGw8qoAijZjUovDgdWEyK4fZkEAOTY9cAYE=; b=Lw4wksxC+MNAmfeoqZuBZ79hx9hOJpoLpYUm/iR+qnUNeyUE/XXO9hyQGP7eAjTQed 7EQUFCR1KT0HKj7zuiMXdAvM+wdfjvE4XLWws56hcG4MUHuZCSlKTYb5YNm3OwJw6hBW uzYvNQOwag4R4hr4Mm58/YI48oo+pKwfoJV6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:x-gm-message-state; bh=DDW96zRIMGw8qoAijZjUovDgdWEyK4fZkEAOTY9cAYE=; b=VLpX8j407iRMmSequxqnYyEX8xl6tem+Geq94MiZU63r/sePvKUx2+aUncLBUVzo1j 3YyCsA2+0r+Nasq8IAmw7RN4ICKEPiMkao+TZaUMp790i+lQQj0uFBwFIodkSm7eBu9r OEotDx6A+j0TS5M6rbZQ3U8Khu1XxhSK+W0/h3vROjehriAx2U+ixiZchKkeaT6zM0Ww 1Mdk39Tblgsn42tJnVrTTEdmJi2ArIoV24fMUyW1JAEt2PmqOxMZ+Sf6YufIsyS/TOhM ulz98EhmOKby5KdvdA5rwWtPilTtznnJsMy7v28cdsHVi9TozngF9ZlFuBF8f4bOXuD0 jkLg== X-Received: by 10.68.239.169 with SMTP id vt9mr37228495pbc.8.1368609634847; Wed, 15 May 2013 02:20:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.38.41 with HTTP; Wed, 15 May 2013 02:20:11 -0700 (PDT) In-Reply-To: References: From: Dave Cardwell Date: Wed, 15 May 2013 10:20:11 +0100 Message-ID: Subject: Re: hiveserver2 Thrift Interface With Perl To: user@hive.apache.org Cc: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=047d7b33d5f41f23e604dcbe4374 X-Gm-Message-State: ALoCoQk23IrRG6eRCf8jXMn0mYDvq91tBwTRXCMB+j3IWEN/TPwL1LzXQkYNznULE34YwkOYlzsX X-Virus-Checked: Checked by ClamAV on apache.org --047d7b33d5f41f23e604dcbe4374 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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. --=20 Best wishes, Dave Cardwell. http://davecardwell.co.uk/ On 15 May 2013 00:05, Carl Steinbach 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 wr= ote: > >> >> 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://:/default;auth=3DnoSasl >> >> thanks >> Prasad >> >> >> On Tue, May 14, 2013 at 3:35 AM, Dave Cardwell = 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=92ve found online, but cannot for the lif= e 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 TCLIServ= ice >>> 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/ >>> >> >> > --047d7b33d5f41f23e604dcbe4374 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
Hi guys,

I had already used the N= OSASL setting to turn off that authentication, so was able to connect to th= e cluster fine.

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


--=A0
Best = wishes,
Dave Cardwell.



On 15 May 2013 00:05, Carl Steinbach <cwsteinbach@gmail.com> wrote:
This SASL module for Perl may be of interest:

=



On Tue, May 1= 4, 2013 at 9:44 AM, Prasad Mujumdar <prasadm@cloudera.com> wrote:

=A0 =A0HiveServer2= uses Thrift SASL transport by default. AFAIK, Thrift doesn't support s= asl 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 pro= perty hive.server2.authentication to NOSASL in the hive-site.xml. Note that= with this change, all other clients like JDBC applications and beeline, wi= ll also need to make non-sasl connection to HiveServer2. The JDBC connectio= n URL should be=A0jdbc:hive2://<host>:<port>/default;auth=3DnoS= asl

thanks
Prasad


On Tue, May 14, 2013 at 3:3= 5 AM, Dave Cardwell <dave@davecardwell.co.uk> wrote:
I wrote a few reporting scripts in Perl t= hat connected to Hive via the Thrift interface.

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

I regenerated the Perl modules from the .thrift files a= nd have tried to translate the Java examples I=92ve found online, but canno= t for the life of me get it working with the new interface.

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

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

--=A0
Best wishes,
Dave Cardwell.




--047d7b33d5f41f23e604dcbe4374--