hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vaibhav Gumashta <>
Subject Re: tfetchresultsresp row returns zero
Date Thu, 29 Jan 2015 05:36:49 GMT
Hi George,

This was done as part of 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.


From: George Livingston <<>>
Reply-To: "<>" <<>>
Date: Wednesday, January 28, 2015 at 2:35 AM
To: "<>" <<>>
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 and rows in results
in all the Hive versions.

        TSocket transport = new TSocket("localhost", 10000);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);
        TCLIService.Client client = new TCLIService.Client(protocol);

        TOpenSessionReq openReq = new TOpenSessionReq();
        TOpenSessionResp openResp = client.OpenSession(openReq);
        TSessionHandle sessHandle = openResp.SessionHandle;

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

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

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

        TCloseOperationReq closeReq = new TCloseOperationReq();
        closeReq.OperationHandle = stmtHandle;
        TCloseSessionReq closeConnectionReq = new TCloseSessionReq();
        closeConnectionReq.SessionHandle = sessHandle;


Thanks in advance.



View raw message