Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.0, Impala 2.0.1, Impala 2.1, Impala 2.1.1
-
None
-
None
Description
The type metadata is not properly populated for VARCHAR when calling the Hiveserver2 GetResultSetMetadata() RPC.
From JDBC/ODBC this issue manifests itself as incorrectly reporting the max size for VARCHAR columns as 32767.
This small program demonstrates the problem:
public class Hs2VarcharTest { public static void main(String[] args) throws TException { TTransport trans = new TSocket("localhost", 21050); trans.open(); TProtocol prot = new TBinaryProtocol(trans); Client c = new Client(prot); TOpenSessionReq openSessReq = new TOpenSessionReq(); TOpenSessionResp openSessionResp = c.OpenSession(openSessReq); TExecuteStatementReq execStmtReq = new TExecuteStatementReq( openSessionResp.getSessionHandle(), "select * from (values(cast('a' as varchar(10)))) v"); TExecuteStatementResp execStmtResp = c.ExecuteStatement(execStmtReq); TGetResultSetMetadataReq metaReq = new TGetResultSetMetadataReq(execStmtResp.getOperationHandle()); TGetResultSetMetadataResp metaResp = c.GetResultSetMetadata(metaReq); TTypeDesc typeDesc = metaResp.getSchema().getColumns().get(0).getTypeDesc(); TTypeQualifiers typeQuals = typeDesc.getTypes().get(0).getPrimitiveEntry().getTypeQualifiers(); System.out.println(typeQuals); <-- prints null } }
Attachments
Issue Links
- is duplicated by
-
IMPALA-1759 Impala Thrift returns STRING not varchar when using OVER() clause
- Resolved