Search in sources :

Example 1 with DrillHiveMetaStoreClient

use of org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient in project drill by apache.

the class HiveSchemaFactory method registerSchemas.

@Override
public void registerSchemas(SchemaConfig schemaConfig, SchemaPlus parent) throws IOException {
    DrillHiveMetaStoreClient mClientForSchemaTree = processUserMetastoreClient;
    if (isDrillImpersonationEnabled) {
        try {
            mClientForSchemaTree = metaStoreClientLoadingCache.get(schemaConfig.getUserName());
        } catch (final ExecutionException e) {
            throw new IOException("Failure setting up Hive metastore client.", e);
        }
    }
    HiveSchema schema = new HiveSchema(schemaConfig, mClientForSchemaTree, schemaName);
    SchemaPlus hPlus = parent.add(schemaName, schema);
    schema.setHolder(hPlus);
}
Also used : DrillHiveMetaStoreClient(org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient) SchemaPlus(org.apache.calcite.schema.SchemaPlus) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 SchemaPlus (org.apache.calcite.schema.SchemaPlus)1 DrillHiveMetaStoreClient (org.apache.drill.exec.store.hive.DrillHiveMetaStoreClient)1