Search in sources :

Example 16 with MetastoreConfig

use of io.trino.plugin.hive.metastore.MetastoreConfig in project trino by trinodb.

the class TestConnectorPushdownRulesWithHive method createLocalQueryRunner.

@Override
protected Optional<LocalQueryRunner> createLocalQueryRunner() {
    baseDir = Files.createTempDir();
    HdfsConfig config = new HdfsConfig();
    HdfsConfiguration configuration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(config), ImmutableSet.of());
    HdfsEnvironment environment = new HdfsEnvironment(configuration, config, new NoHdfsAuthentication());
    metastore = new FileHiveMetastore(new NodeVersion("test_version"), environment, new MetastoreConfig(), new FileHiveMetastoreConfig().setCatalogDirectory(baseDir.toURI().toString()).setMetastoreUser("test"));
    Database database = Database.builder().setDatabaseName(SCHEMA_NAME).setOwnerName(Optional.of("public")).setOwnerType(Optional.of(PrincipalType.ROLE)).build();
    metastore.createDatabase(database);
    LocalQueryRunner queryRunner = LocalQueryRunner.create(HIVE_SESSION);
    queryRunner.createCatalog(HIVE_CATALOG_NAME, new TestingHiveConnectorFactory(metastore), ImmutableMap.of());
    return Optional.of(queryRunner);
}
Also used : HdfsConfigurationInitializer(io.trino.plugin.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(io.trino.plugin.hive.HiveHdfsConfiguration) MetastoreConfig(io.trino.plugin.hive.metastore.MetastoreConfig) FileHiveMetastoreConfig(io.trino.plugin.hive.metastore.file.FileHiveMetastoreConfig) HdfsConfig(io.trino.plugin.hive.HdfsConfig) HiveHdfsConfiguration(io.trino.plugin.hive.HiveHdfsConfiguration) HdfsConfiguration(io.trino.plugin.hive.HdfsConfiguration) NoHdfsAuthentication(io.trino.plugin.hive.authentication.NoHdfsAuthentication) LocalQueryRunner(io.trino.testing.LocalQueryRunner) HdfsEnvironment(io.trino.plugin.hive.HdfsEnvironment) NodeVersion(io.trino.plugin.hive.NodeVersion) FileHiveMetastoreConfig(io.trino.plugin.hive.metastore.file.FileHiveMetastoreConfig) FileHiveMetastore(io.trino.plugin.hive.metastore.file.FileHiveMetastore) TestingHiveConnectorFactory(io.trino.plugin.hive.TestingHiveConnectorFactory) Database(io.trino.plugin.hive.metastore.Database)

Example 17 with MetastoreConfig

use of io.trino.plugin.hive.metastore.MetastoreConfig in project trino by trinodb.

the class TestHiveGlueMetastore method createMetastore.

@Override
protected HiveMetastore createMetastore(File tempDir, HiveIdentity identity) {
    GlueHiveMetastoreConfig glueConfig = new GlueHiveMetastoreConfig();
    glueConfig.setDefaultWarehouseDir(tempDir.toURI().toString());
    glueConfig.setAssumeCanonicalPartitionKeys(true);
    Executor executor = new BoundedExecutor(this.executor, 10);
    return new GlueHiveMetastore(HDFS_ENVIRONMENT, glueConfig, executor, new DefaultGlueColumnStatisticsProviderFactory(glueConfig, executor, executor), Optional.empty(), new DefaultGlueMetastoreTableFilterProvider(new MetastoreConfig().setHideDeltaLakeTables(true)).get());
}
Also used : BoundedExecutor(io.airlift.concurrent.BoundedExecutor) Executor(java.util.concurrent.Executor) MetastoreConfig(io.trino.plugin.hive.metastore.MetastoreConfig) BoundedExecutor(io.airlift.concurrent.BoundedExecutor)

Aggregations

MetastoreConfig (io.trino.plugin.hive.metastore.MetastoreConfig)17 NoHdfsAuthentication (io.trino.plugin.hive.authentication.NoHdfsAuthentication)15 HdfsConfig (io.trino.plugin.hive.HdfsConfig)11 HdfsConfiguration (io.trino.plugin.hive.HdfsConfiguration)11 HdfsConfigurationInitializer (io.trino.plugin.hive.HdfsConfigurationInitializer)11 HdfsEnvironment (io.trino.plugin.hive.HdfsEnvironment)11 HiveHdfsConfiguration (io.trino.plugin.hive.HiveHdfsConfiguration)11 NodeVersion (io.trino.plugin.hive.NodeVersion)11 FileHiveMetastore (io.trino.plugin.hive.metastore.file.FileHiveMetastore)10 FileHiveMetastoreConfig (io.trino.plugin.hive.metastore.file.FileHiveMetastoreConfig)10 HiveMetastore (io.trino.plugin.hive.metastore.HiveMetastore)6 CatalogName (io.trino.plugin.base.CatalogName)4 DistributedQueryRunner (io.trino.testing.DistributedQueryRunner)4 File (java.io.File)4 Database (io.trino.plugin.hive.metastore.Database)3 HostAndPort (com.google.common.net.HostAndPort)2 BoundedExecutor (io.airlift.concurrent.BoundedExecutor)2 Session (io.trino.Session)2 CachingDeltaLakeStatisticsAccess (io.trino.plugin.deltalake.statistics.CachingDeltaLakeStatisticsAccess)2 MetaDirStatisticsAccess (io.trino.plugin.deltalake.statistics.MetaDirStatisticsAccess)2