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