Search in sources :

Example 1 with GetPrimaryKeysOperation

use of org.apache.hive.service.cli.operation.GetPrimaryKeysOperation 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);
    }
}
Also used : HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationManager(org.apache.hive.service.cli.operation.OperationManager) GetPrimaryKeysOperation(org.apache.hive.service.cli.operation.GetPrimaryKeysOperation) OperationHandle(org.apache.hive.service.cli.OperationHandle)

Aggregations

HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1 OperationHandle (org.apache.hive.service.cli.OperationHandle)1 GetPrimaryKeysOperation (org.apache.hive.service.cli.operation.GetPrimaryKeysOperation)1 OperationManager (org.apache.hive.service.cli.operation.OperationManager)1