Search in sources :

Example 6 with RdbmsMetastoreException

use of org.apache.drill.metastore.rdbms.exception.RdbmsMetastoreException in project drill by apache.

the class RdbmsModify method executeOperations.

/**
 * Executes list of provided RDBMS operations in one transaction.
 *
 * @param operations list of RDBMS operations
 */
private void executeOperations(List<RdbmsOperation> operations) {
    try (DSLContext executor = context.executorProvider().executor()) {
        executor.transaction(configuration -> {
            DSLContext transactionalExecutor = DSL.using(configuration);
            operations.forEach(operation -> operation.execute(transactionalExecutor));
        });
    } catch (RuntimeException e) {
        throw new RdbmsMetastoreException("Error during Metastore modify operation execution: " + e.getMessage(), e);
    }
}
Also used : RdbmsMetastoreException(org.apache.drill.metastore.rdbms.exception.RdbmsMetastoreException) DSLContext(org.jooq.DSLContext)

Aggregations

RdbmsMetastoreException (org.apache.drill.metastore.rdbms.exception.RdbmsMetastoreException)6 Condition (org.jooq.Condition)2 DSLContext (org.jooq.DSLContext)2 Config (com.typesafe.config.Config)1 HikariConfig (com.zaxxer.hikari.HikariConfig)1 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 Connection (java.sql.Connection)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 Liquibase (liquibase.Liquibase)1 Database (liquibase.database.Database)1 JdbcConnection (liquibase.database.jvm.JdbcConnection)1 ClassLoaderResourceAccessor (liquibase.resource.ClassLoaderResourceAccessor)1 DrillConfig (org.apache.drill.common.config.DrillConfig)1 TableMetadataUnit (org.apache.drill.metastore.components.tables.TableMetadataUnit)1 MetadataType (org.apache.drill.metastore.metadata.MetadataType)1 RdbmsBaseTest (org.apache.drill.metastore.rdbms.RdbmsBaseTest)1 MetadataMapper (org.apache.drill.metastore.rdbms.transform.MetadataMapper)1 Field (org.jooq.Field)1 Record (org.jooq.Record)1