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 98CBF17996 for ; Thu, 29 Jan 2015 12:14:50 +0000 (UTC) Received: (qmail 98873 invoked by uid 500); 29 Jan 2015 12:14:49 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 98810 invoked by uid 500); 29 Jan 2015 12:14:49 -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 98800 invoked by uid 99); 29 Jan 2015 12:14:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2015 12:14:49 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of georgeli2010@gmail.com designates 209.85.218.52 as permitted sender) Received: from [209.85.218.52] (HELO mail-oi0-f52.google.com) (209.85.218.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2015 12:14:44 +0000 Received: by mail-oi0-f52.google.com with SMTP id h136so25977354oig.11 for ; Thu, 29 Jan 2015 04:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=E2AXi2L6V3/lPyKWdyO6458Bi2O0UXROvH4moAKoscc=; b=0dfdZ7Mzeo7KqSv9ub+6s9J03fliOr+aSJQTtQNzDdjMs+kIZqyqh8d9FaSSTtmqfi P71yURJaQZl7XLmgUf6h3Jo7XeluYkUeQMoioO/GIQzV2bl7EbOYMBT8C4jk90nz8zIE xt6ydBxOjLN3Tz521GJiHYOCrlmeG23OkHOi0AAvM2THLQ6OYfB9ZV7hTspJSUcKwTA0 L+72fRuNSBaaO655LFLXccgCVl8E5K7LCDfDFfAASSdgb0sI3M2btH9bQigiULtCrpCi ZEfTxabiuIZi/5cV8mSgnYTdv7X2vg14Cad2m9VRyfet9cByo75nNXksgRyRhzxbAMMC NDCw== X-Received: by 10.182.246.105 with SMTP id xv9mr144908obc.74.1422533574032; Thu, 29 Jan 2015 04:12:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.250.50 with HTTP; Thu, 29 Jan 2015 04:12:33 -0800 (PST) In-Reply-To: References: From: George Livingston Date: Thu, 29 Jan 2015 07:12:33 -0500 Message-ID: Subject: Re: tfetchresultsresp row returns zero To: user Content-Type: multipart/alternative; boundary=001a11c2fb4c5ca668050dc9683a X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2fb4c5ca668050dc9683a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Vaibhav, Thank you so much, it was very helpful for me. Regards, George On Thu, Jan 29, 2015 at 12:36 AM, Vaibhav Gumashta < vgumashta@hortonworks.com> wrote: > Hi George, > > This was done as part of https://issues.apache.org/jira/browse/HIVE-3746= . > The reason was that the previous serialization design (row major) was ver= y > inefficient and resulted in a lot of unnecessary network traffic. The > current design (column major) addresses some of those issues. > > Thanks, > =E2=80=94Vaibhav > > > From: George Livingston > Reply-To: "user@hive.apache.org" > Date: Wednesday, January 28, 2015 at 2:35 AM > To: "user@hive.apache.org" > Subject: tfetchresultsresp row returns zero > > Hi Team, > > I have generated C# source for TCLIService using thrift, to connect to > the Hiveserver2, when I connect the hiveserver2 with Hive version 0.13, > TFetchResultsResp result is always returned in values of columns and not = in > rows i.e. rows count always zero. > > When I tried with the Hive version 0.12, TFetchResultsResp result is > always returned in rows and not in column i.e. column count always zero. > > Please advise whether i need to set any property to fetch both columns an= d > rows in results in all the Hive versions. > > TSocket transport =3D new TSocket("localhost", 10000); > TBinaryProtocol protocol =3D new TBinaryProtocol(transport); > TCLIService.Client client =3D new TCLIService.Client(protocol); > > transport.Open(); > TOpenSessionReq openReq =3D new TOpenSessionReq(); > TOpenSessionResp openResp =3D client.OpenSession(openReq); > TSessionHandle sessHandle =3D openResp.SessionHandle; > > TExecuteStatementReq execReq =3D new TExecuteStatementReq(); > execReq.SessionHandle =3D sessHandle; > execReq.Statement =3D "show tables"; > TExecuteStatementResp execResp =3D client.ExecuteStatement(execRe= q); > TOperationHandle stmtHandle =3D execResp.OperationHandle; > > TFetchResultsReq fetchReq =3D new TFetchResultsReq(); > fetchReq.OperationHandle =3D stmtHandle; > fetchReq.Orientation =3D TFetchOrientation.FETCH_FIRST; > fetchReq.MaxRows =3D 99999999; > TFetchResultsResp resultsResp =3D client.FetchResults(fetchReq); > > TRowSet resultsSet =3D resultsResp.Results; > //In hive version 0.13, rows count zero > List resultRows =3D resultsSet.Rows; > //In Hive version 0.12, columns count zero > List resultColumn =3D resultsSet.Columns; > > > TCloseOperationReq closeReq =3D new TCloseOperationReq(); > closeReq.OperationHandle =3D stmtHandle; > client.CloseOperation(closeReq); > TCloseSessionReq closeConnectionReq =3D new TCloseSessionReq(); > closeConnectionReq.SessionHandle =3D sessHandle; > client.CloseSession(closeConnectionReq); > > transport.Close(); > > Thanks in advance. > > Regards, > > George > --001a11c2fb4c5ca668050dc9683a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Vaibhav,

= Thank you so much, it was very helpful for me.
Regards,
George

On Thu, Jan 29= , 2015 at 12:36 AM, Vaibhav Gumashta <vgumashta@hortonworks.com> wrote:
Hi George,

This was done as part of=C2=A0https://issues.apache.org/jira/browse= /HIVE-3746. The reason was that the previous serialization design (row = major) was very inefficient and resulted in a lot of unnecessary network traffic. The current design (column major) addresses some of those= issues.

Thanks,
=E2=80=94Vaibhav


From: George Livingston <georgeli2010@gmail.com= >
Reply-To: "user@hive.apache.org" <<= a href=3D"mailto:user@hive.apache.org" target=3D"_blank">user@hive.apache.o= rg>
Date: Wednesday, January 28, 2015 a= t 2:35 AM
To: "user@hive.apache.org" <user@hive.apache.org= >
Subject: tfetchresultsresp row retu= rns zero

Hi Team,

I have generated C# source for TCLIS= ervice using thrift, to connect to the Hiveserver2, when I connect the hive= server2 with Hive version 0.13, TFetchResultsResp result is always returned in values of columns and not in rows i.e. rows c= ount always zero.

When I tried with the Hive version 0.12, TFetchResultsResp result is always= returned in rows and not in column i.e. column count always zero.

Please advise whether i need to set any property to fetch both columns and = rows in results in all the Hive versions.

        TSocket transport =3D new TS=
ocket("localhost", 10000);
        TBinaryProtocol protocol =3D new TBinaryProtocol(transport);
        TCLIService.Client client =3D new TCLIService.Client(proto=
col);

        transport.Open();
        TOpenSessionReq openReq =3D new TOpenSessionReq();
        TOpenSessionResp openResp =3D client.OpenSession(openReq);<=
span style=3D"margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        TSessionHandle sessHandle =3D openResp.SessionHandle;

        TExecuteStatementReq execReq =3D new TExecuteStatementReq();
        execReq.SessionHandle =3D sessHandle;
        execReq.Statement =3D "show tables";
        TExecuteStatementResp execResp =3D client.ExecuteStatement(execRe=
q=
);
        TOperationHandle stmtHandle =3D execResp.OperationHandle=
;=


        TFetchResultsReq fetchReq =3D new TFetchResultsReq();
        fetchReq.OperationHandle =3D stmtHandle;
        fetchReq.Orientation =3D TFetchOrientation.FETCH_FIRST;
        fetchReq.MaxRows =3D 99999999;
        TFetchResultsResp resultsResp =3D client.FetchResults(fetchReq);

        TRowSet resultsSet =3D resultsResp.Results;
        //In hive version 0.13, rows count zero
        List<TRow> resultRows =3D resultsSet.Rows;
        //In Hive version 0.12, columns count zero
        List<TColumn> resultColumn =3D resultsSet.Columns;


        TCloseOperationReq closeReq =3D new TCloseOperationReq<=
span style=3D"margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">();
        closeReq.OperationHandle =3D stmtHandle;
        client.CloseOperation(closeReq);
        TCloseSessionReq closeConnectionReq =3D new TCloseSessionReq();=

        closeConnectionReq.SessionHandle =3D sessHandle;
        client.CloseSession(closeConnectionReq);

        transport.Close();

Thanks in advance.

Regards,

George


--001a11c2fb4c5ca668050dc9683a--