Search in sources :

Example 1 with TGetTypeInfoResp

use of org.apache.hive.service.rpc.thrift.TGetTypeInfoResp 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 TGetTypeInfoResp

use of org.apache.hive.service.rpc.thrift.TGetTypeInfoResp 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)

Example 3 with TGetTypeInfoResp

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

the class ThriftCLIService method GetTypeInfo.

@Override
public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException {
    TGetTypeInfoResp resp = new TGetTypeInfoResp();
    try {
        OperationHandle operationHandle = cliService.getTypeInfo(new SessionHandle(req.getSessionHandle()));
        resp.setOperationHandle(operationHandle.toTOperationHandle());
        resp.setStatus(OK_STATUS);
    } catch (Exception e) {
        LOG.warn("Error getting type info: ", e);
        resp.setStatus(HiveSQLException.toTStatus(e));
    }
    return resp;
}
Also used : TGetTypeInfoResp(org.apache.hive.service.rpc.thrift.TGetTypeInfoResp) SessionHandle(org.apache.hive.service.cli.SessionHandle) OperationHandle(org.apache.hive.service.cli.OperationHandle) LoginException(javax.security.auth.login.LoginException) ServiceException(org.apache.hive.service.ServiceException) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Aggregations

TGetTypeInfoResp (org.apache.hive.service.rpc.thrift.TGetTypeInfoResp)3 TException (org.apache.thrift.TException)3 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)2 OperationHandle (org.apache.hive.service.cli.OperationHandle)2 TGetTypeInfoReq (org.apache.hive.service.rpc.thrift.TGetTypeInfoReq)2 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 SQLException (java.sql.SQLException)1 LoginException (javax.security.auth.login.LoginException)1 ServiceException (org.apache.hive.service.ServiceException)1 SessionHandle (org.apache.hive.service.cli.SessionHandle)1 TProtocolVersion (org.apache.hive.service.rpc.thrift.TProtocolVersion)1