Search in sources :

Example 11 with HdfsEnvironment

use of com.facebook.presto.hive.HdfsEnvironment in project presto by prestodb.

the class TestHiveClientGlueMetastore method createMetastore.

/**
 * GlueHiveMetastore currently uses AWS Default Credential Provider Chain,
 * See https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default
 * on ways to set your AWS credentials which will be needed to run this test.
 */
@Override
protected ExtendedHiveMetastore createMetastore(File tempDir) {
    HiveClientConfig hiveClientConfig = new HiveClientConfig();
    MetastoreClientConfig metastoreClientConfig = new MetastoreClientConfig();
    HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(hiveClientConfig, metastoreClientConfig), ImmutableSet.of());
    HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, metastoreClientConfig, new NoHdfsAuthentication());
    GlueHiveMetastoreConfig glueConfig = new GlueHiveMetastoreConfig();
    glueConfig.setDefaultWarehouseDir(tempDir.toURI().toString());
    return new GlueHiveMetastore(hdfsEnvironment, glueConfig, executor);
}
Also used : HdfsConfigurationInitializer(com.facebook.presto.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(com.facebook.presto.hive.HiveHdfsConfiguration) HdfsConfiguration(com.facebook.presto.hive.HdfsConfiguration) HiveHdfsConfiguration(com.facebook.presto.hive.HiveHdfsConfiguration) NoHdfsAuthentication(com.facebook.presto.hive.authentication.NoHdfsAuthentication) MetastoreClientConfig(com.facebook.presto.hive.MetastoreClientConfig) HiveClientConfig(com.facebook.presto.hive.HiveClientConfig) HdfsEnvironment(com.facebook.presto.hive.HdfsEnvironment)

Aggregations

HdfsEnvironment (com.facebook.presto.hive.HdfsEnvironment)11 PrestoException (com.facebook.presto.spi.PrestoException)9 IOException (java.io.IOException)9 ConnectorSession (com.facebook.presto.spi.ConnectorSession)8 Type (com.facebook.presto.common.type.Type)7 TypeManager (com.facebook.presto.common.type.TypeManager)7 FileFormatDataSourceStats (com.facebook.presto.hive.FileFormatDataSourceStats)7 HdfsParquetDataSource.buildHdfsParquetDataSource (com.facebook.presto.hive.parquet.HdfsParquetDataSource.buildHdfsParquetDataSource)7 ConnectorPageSource (com.facebook.presto.spi.ConnectorPageSource)7 ImmutableList (com.google.common.collect.ImmutableList)7 ImmutableMap (com.google.common.collect.ImmutableMap)7 List (java.util.List)7 Objects.requireNonNull (java.util.Objects.requireNonNull)7 Optional (java.util.Optional)7 Path (org.apache.hadoop.fs.Path)7 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)6 HiveClientConfig (com.facebook.presto.hive.HiveClientConfig)6 SchemaTableName (com.facebook.presto.spi.SchemaTableName)6 DataSize (io.airlift.units.DataSize)6 String.format (java.lang.String.format)6