Search in sources :

Example 1 with TGetTypeInfoReq

use of org.apache.hive.service.rpc.thrift.TGetTypeInfoReq in project hive by apache.

the class HiveDatabaseMetaData method getTypeInfo.

public ResultSet getTypeInfo() throws SQLException {
    TGetTypeInfoResp getTypeInfoResp;
    TGetTypeInfoReq getTypeInfoReq = new TGetTypeInfoReq();
    getTypeInfoReq.setSessionHandle(sessHandle);
    try {
        getTypeInfoResp = client.GetTypeInfo(getTypeInfoReq);
    } catch (TException e) {
        throw new SQLException(e.getMessage(), "08S01", e);
    }
    Utils.verifySuccess(getTypeInfoResp.getStatus());
    return new HiveQueryResultSet.Builder(connection).setClient(client).setSessionHandle(sessHandle).setStmtHandle(getTypeInfoResp.getOperationHandle()).build();
}
Also used : TException(org.apache.thrift.TException) TGetTypeInfoReq(org.apache.hive.service.rpc.thrift.TGetTypeInfoReq) TGetTypeInfoResp(org.apache.hive.service.rpc.thrift.TGetTypeInfoResp) SQLException(java.sql.SQLException)

Example 2 with TGetTypeInfoReq

use of org.apache.hive.service.rpc.thrift.TGetTypeInfoReq in project hive by apache.

the class ThriftCLIServiceClient method getTypeInfo.

/* (non-Javadoc)
   * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle)
   */
@Override
public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException {
    try {
        TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle());
        TGetTypeInfoResp resp = cliService.GetTypeInfo(req);
        checkStatus(resp.getStatus());
        TProtocolVersion protocol = sessionHandle.getProtocolVersion();
        return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
        throw e;
    } catch (Exception e) {
        throw new HiveSQLException(e);
    }
}
Also used : TGetTypeInfoReq(org.apache.hive.service.rpc.thrift.TGetTypeInfoReq) TGetTypeInfoResp(org.apache.hive.service.rpc.thrift.TGetTypeInfoResp) TProtocolVersion(org.apache.hive.service.rpc.thrift.TProtocolVersion) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationHandle(org.apache.hive.service.cli.OperationHandle) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Aggregations

TGetTypeInfoReq (org.apache.hive.service.rpc.thrift.TGetTypeInfoReq)2 TGetTypeInfoResp (org.apache.hive.service.rpc.thrift.TGetTypeInfoResp)2 TException (org.apache.thrift.TException)2 SQLException (java.sql.SQLException)1 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1 OperationHandle (org.apache.hive.service.cli.OperationHandle)1 TProtocolVersion (org.apache.hive.service.rpc.thrift.TProtocolVersion)1