use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class ThriftCLIService method CancelOperation.
@Override
public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException {
TCancelOperationResp resp = new TCancelOperationResp();
try {
cliService.cancelOperation(new OperationHandle(req.getOperationHandle()));
resp.setStatus(OK_STATUS);
} catch (Exception e) {
LOG.error("Failed to get cancel operation [request: {}]", req, e);
resp.setStatus(HiveSQLException.toTStatus(e));
}
return resp;
}
use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class ThriftCLIService method GetFunctions.
@Override
public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException {
TGetFunctionsResp resp = new TGetFunctionsResp();
try {
OperationHandle opHandle = cliService.getFunctions(new SessionHandle(req.getSessionHandle()), req.getCatalogName(), req.getSchemaName(), req.getFunctionName());
resp.setOperationHandle(opHandle.toTOperationHandle());
resp.setStatus(OK_STATUS);
} catch (Exception e) {
LOG.error("Failed to get function: [request: {}]", req, e);
resp.setStatus(HiveSQLException.toTStatus(e));
}
return resp;
}
use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class HiveSessionImpl method getPrimaryKeys.
@Override
public OperationHandle getPrimaryKeys(String catalog, String schema, String table) throws HiveSQLException {
acquire(true, true);
OperationManager operationManager = getOperationManager();
GetPrimaryKeysOperation operation = operationManager.newGetPrimaryKeysOperation(getSession(), catalog, schema, table);
OperationHandle opHandle = operation.getHandle();
try {
addOpHandle(opHandle);
operation.run();
return opHandle;
} catch (HiveSQLException e) {
removeOpHandle(opHandle);
operationManager.closeOperation(opHandle);
throw e;
} finally {
release(true, true);
}
}
use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class HiveSessionImpl method getSchemas.
@Override
public OperationHandle getSchemas(String catalogName, String schemaName) throws HiveSQLException {
acquire(true, true);
OperationManager operationManager = getOperationManager();
GetSchemasOperation operation = operationManager.newGetSchemasOperation(getSession(), catalogName, schemaName);
OperationHandle opHandle = operation.getHandle();
try {
addOpHandle(opHandle);
operation.run();
return opHandle;
} catch (HiveSQLException e) {
removeOpHandle(opHandle);
operationManager.closeOperation(opHandle);
throw e;
} finally {
release(true, true);
}
}
use of org.apache.hive.service.cli.OperationHandle in project hive by apache.
the class HiveSessionImpl method getTables.
@Override
public OperationHandle getTables(String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException {
acquire(true, true);
OperationManager operationManager = getOperationManager();
MetadataOperation operation = operationManager.newGetTablesOperation(getSession(), catalogName, schemaName, tableName, tableTypes);
OperationHandle opHandle = operation.getHandle();
try {
addOpHandle(opHandle);
operation.run();
return opHandle;
} catch (HiveSQLException e) {
removeOpHandle(opHandle);
operationManager.closeOperation(opHandle);
throw e;
} finally {
release(true, true);
}
}
Aggregations