Search in sources :

Example 1 with HiveHdfsConfiguration

use of io.prestosql.plugin.hive.HiveHdfsConfiguration in project hetu-core by openlookeng.

the class FileHiveMetastore method createTestingFileHiveMetastore.

public static FileHiveMetastore createTestingFileHiveMetastore(File catalogDirectory) {
    HiveConfig hiveConfig = new HiveConfig();
    HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(hiveConfig), ImmutableSet.of());
    HdfsEnvironment localHdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveConfig, new NoHdfsAuthentication());
    return new FileHiveMetastore(localHdfsEnvironment, catalogDirectory.toURI().toString(), "test");
}
Also used : HdfsConfigurationInitializer(io.prestosql.plugin.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) HdfsConfiguration(io.prestosql.plugin.hive.HdfsConfiguration) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) NoHdfsAuthentication(io.prestosql.plugin.hive.authentication.NoHdfsAuthentication) HiveConfig(io.prestosql.plugin.hive.HiveConfig) HdfsEnvironment(io.prestosql.plugin.hive.HdfsEnvironment)

Example 2 with HiveHdfsConfiguration

use of io.prestosql.plugin.hive.HiveHdfsConfiguration in project boostkit-bigdata by kunpengcompute.

the class FileHiveMetastore method createTestingFileHiveMetastore.

public static FileHiveMetastore createTestingFileHiveMetastore(File catalogDirectory) {
    HiveConfig hiveConfig = new HiveConfig();
    HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(hiveConfig), ImmutableSet.of());
    HdfsEnvironment localHdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveConfig, new NoHdfsAuthentication());
    return new FileHiveMetastore(localHdfsEnvironment, catalogDirectory.toURI().toString(), "test");
}
Also used : HdfsConfigurationInitializer(io.prestosql.plugin.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) HdfsConfiguration(io.prestosql.plugin.hive.HdfsConfiguration) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) NoHdfsAuthentication(io.prestosql.plugin.hive.authentication.NoHdfsAuthentication) HiveConfig(io.prestosql.plugin.hive.HiveConfig) HdfsEnvironment(io.prestosql.plugin.hive.HdfsEnvironment)

Example 3 with HiveHdfsConfiguration

use of io.prestosql.plugin.hive.HiveHdfsConfiguration in project boostkit-bigdata by kunpengcompute.

the class TestParquetPageSourceFactory method setUp.

@BeforeClass
public void setUp() {
    HiveHdfsConfiguration hiveHdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(new HiveConfig(), ImmutableSet.of()), ImmutableSet.of());
    HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hiveHdfsConfiguration, new HiveConfig(), new NoHdfsAuthentication());
    parquetPageSourceFactory = new ParquetPageSourceFactory(new TestingTypeManager(), hdfsEnvironment, new FileFormatDataSourceStats(), new HiveConfig());
}
Also used : HdfsConfigurationInitializer(io.prestosql.plugin.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) FileFormatDataSourceStats(io.prestosql.plugin.hive.FileFormatDataSourceStats) NoHdfsAuthentication(io.prestosql.plugin.hive.authentication.NoHdfsAuthentication) TestingTypeManager(io.prestosql.spi.type.testing.TestingTypeManager) HiveConfig(io.prestosql.plugin.hive.HiveConfig) HdfsEnvironment(io.prestosql.plugin.hive.HdfsEnvironment) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with HiveHdfsConfiguration

use of io.prestosql.plugin.hive.HiveHdfsConfiguration in project hetu-core by openlookeng.

the class TestSpatialJoins method createQueryRunner.

private static DistributedQueryRunner createQueryRunner() throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder().setSource(TestSpatialJoins.class.getSimpleName()).setCatalog("hive").setSchema("default").build(), 4);
    queryRunner.installPlugin(new GeoPlugin());
    File baseDir = queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data").toFile();
    HiveConfig hiveConfig = new HiveConfig();
    HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(hiveConfig), ImmutableSet.of());
    HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveConfig, new NoHdfsAuthentication());
    FileHiveMetastore metastore = new FileHiveMetastore(hdfsEnvironment, baseDir.toURI().toString(), "test");
    metastore.createDatabase(new HiveIdentity(SESSION), Database.builder().setDatabaseName("default").setOwnerName("public").setOwnerType(PrincipalType.ROLE).build());
    queryRunner.installPlugin(new HivePlugin("hive", Optional.of(metastore)));
    queryRunner.createCatalog("hive", "hive");
    return queryRunner;
}
Also used : HdfsConfigurationInitializer(io.prestosql.plugin.hive.HdfsConfigurationInitializer) DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) HivePlugin(io.prestosql.plugin.hive.HivePlugin) HdfsConfiguration(io.prestosql.plugin.hive.HdfsConfiguration) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) NoHdfsAuthentication(io.prestosql.plugin.hive.authentication.NoHdfsAuthentication) HiveIdentity(io.prestosql.plugin.hive.authentication.HiveIdentity) HiveConfig(io.prestosql.plugin.hive.HiveConfig) HdfsEnvironment(io.prestosql.plugin.hive.HdfsEnvironment) FileHiveMetastore(io.prestosql.plugin.hive.metastore.file.FileHiveMetastore) File(java.io.File)

Example 5 with HiveHdfsConfiguration

use of io.prestosql.plugin.hive.HiveHdfsConfiguration in project hetu-core by openlookeng.

the class TestHiveGlueMetastore 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 HiveMetastore createMetastore(File tempDir) {
    HiveConfig hiveConfig = new HiveConfig();
    HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationInitializer(hiveConfig), ImmutableSet.of());
    HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveConfig, new NoHdfsAuthentication());
    GlueHiveMetastoreConfig glueConfig = new GlueHiveMetastoreConfig();
    glueConfig.setDefaultWarehouseDir(tempDir.toURI().toString());
    return new GlueHiveMetastore(hdfsEnvironment, glueConfig);
}
Also used : HdfsConfigurationInitializer(io.prestosql.plugin.hive.HdfsConfigurationInitializer) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) HdfsConfiguration(io.prestosql.plugin.hive.HdfsConfiguration) HiveHdfsConfiguration(io.prestosql.plugin.hive.HiveHdfsConfiguration) NoHdfsAuthentication(io.prestosql.plugin.hive.authentication.NoHdfsAuthentication) HiveConfig(io.prestosql.plugin.hive.HiveConfig) HdfsEnvironment(io.prestosql.plugin.hive.HdfsEnvironment)

Aggregations

HdfsConfigurationInitializer (io.prestosql.plugin.hive.HdfsConfigurationInitializer)7 HdfsEnvironment (io.prestosql.plugin.hive.HdfsEnvironment)7 HiveConfig (io.prestosql.plugin.hive.HiveConfig)7 HiveHdfsConfiguration (io.prestosql.plugin.hive.HiveHdfsConfiguration)7 NoHdfsAuthentication (io.prestosql.plugin.hive.authentication.NoHdfsAuthentication)7 HdfsConfiguration (io.prestosql.plugin.hive.HdfsConfiguration)5 FileFormatDataSourceStats (io.prestosql.plugin.hive.FileFormatDataSourceStats)2 TestingTypeManager (io.prestosql.spi.type.testing.TestingTypeManager)2 BeforeClass (org.testng.annotations.BeforeClass)2 HivePlugin (io.prestosql.plugin.hive.HivePlugin)1 HiveIdentity (io.prestosql.plugin.hive.authentication.HiveIdentity)1 FileHiveMetastore (io.prestosql.plugin.hive.metastore.file.FileHiveMetastore)1 DistributedQueryRunner (io.prestosql.tests.DistributedQueryRunner)1 File (java.io.File)1