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();
}
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);
}
}
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;
}
Aggregations