use of org.apache.hive.service.rpc.thrift.TGetPrimaryKeysReq in project hive by apache.
the class ThriftCLIServiceClient method getPrimaryKeys.
@Override
public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, String schema, String table) throws HiveSQLException {
try {
TGetPrimaryKeysReq req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle());
req.setCatalogName(catalog);
req.setSchemaName(schema);
req.setTableName(table);
TGetPrimaryKeysResp resp = cliService.GetPrimaryKeys(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.TGetPrimaryKeysReq in project hive by apache.
the class HiveDatabaseMetaData method getPrimaryKeys.
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
TGetPrimaryKeysResp getPKResp;
TGetPrimaryKeysReq getPKReq = new TGetPrimaryKeysReq(sessHandle);
getPKReq.setTableName(table);
getPKReq.setSchemaName(schema);
getPKReq.setCatalogName(catalog);
try {
getPKResp = client.GetPrimaryKeys(getPKReq);
} catch (TException e) {
throw new SQLException(e.getMessage(), "08S01", e);
}
Utils.verifySuccess(getPKResp.getStatus());
return new HiveQueryResultSet.Builder(connection).setClient(client).setStmtHandle(getPKResp.getOperationHandle()).build();
}
Aggregations