Search in sources :

Example 1 with MetadataOperation

use of org.apache.hive.service.cli.operation.MetadataOperation 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 {
        operation.run();
        addOpHandle(opHandle);
        return opHandle;
    } catch (HiveSQLException e) {
        operationManager.closeOperation(opHandle);
        throw e;
    } finally {
        release(true, true);
    }
}
Also used : MetadataOperation(org.apache.hive.service.cli.operation.MetadataOperation) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationManager(org.apache.hive.service.cli.operation.OperationManager) OperationHandle(org.apache.hive.service.cli.OperationHandle)

Aggregations

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