Search in sources :

Example 31 with TpchPlugin

use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.

the class SqlServerQueryRunner method createSqlServerQueryRunner.

public static QueryRunner createSqlServerQueryRunner(TestingSqlServer testingSqlServer, Map<String, String> inputConnectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
    Map<String, String> connectorProperties = inputConnectorProperties;
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession()).build();
    try {
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        connectorProperties = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
        connectorProperties.putIfAbsent("connection-url", testingSqlServer.getJdbcUrl());
        connectorProperties.putIfAbsent("connection-user", TestingSqlServer.USER);
        connectorProperties.putIfAbsent("connection-password", TestingSqlServer.PASSWORD);
        connectorProperties.putIfAbsent("allow-drop-table", "true");
        queryRunner.installPlugin(new SqlServerPlugin());
        queryRunner.createCatalog(CATALOG, "sqlserver", connectorProperties);
        provisionTables(createSession(), queryRunner, tables);
        return queryRunner;
    } catch (Throwable e) {
        closeAllSuppress(e, queryRunner);
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 32 with TpchPlugin

use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.

the class H2TestUtil method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao, String environment) throws Exception {
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().setCatalog("tpch").setSchema("tiny").build()).setNodeCount(2).setEnvironment(environment).build();
    try {
        Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
        queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
        queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(CONFIGURATION_MANAGER_TYPE, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl, "node.environment", environment));
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        setup(queryRunner, dao, environment);
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) PrestoException(io.prestosql.spi.PrestoException) Plugin(io.prestosql.spi.Plugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 33 with TpchPlugin

use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.

the class TestFinalQueryInfo method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(Session session) throws Exception {
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).setNodeCount(2).build();
    try {
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 34 with TpchPlugin

use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.

the class TestQueryRunnerUtil method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().build()).setExtraProperties(extraProperties).setNodeCount(2).build();
    try {
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 35 with TpchPlugin

use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.

the class TestCachedSqlQueryExecution method setupWithExecutionPlanCacheDisabled.

private void setupWithExecutionPlanCacheDisabled(Session session) throws Exception {
    Map<String, String> properties = new HashMap<>();
    properties.putIfAbsent("hetu.executionplan.cache.enabled", "false");
    queryRunner = new DistributedQueryRunner(session, 1, properties);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");
}
Also used : HashMap(java.util.HashMap) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Aggregations

TpchPlugin (io.prestosql.plugin.tpch.TpchPlugin)35 DistributedQueryRunner (io.prestosql.tests.DistributedQueryRunner)22 HashMap (java.util.HashMap)10 BeforeClass (org.testng.annotations.BeforeClass)10 TestingPrestoServer (io.prestosql.server.testing.TestingPrestoServer)8 File (java.io.File)5 HetuMetastorePlugin (io.hetu.core.metastore.HetuMetastorePlugin)4 BlackHolePlugin (io.prestosql.plugin.blackhole.BlackHolePlugin)4 IOException (java.io.IOException)4 BufferedWriter (java.io.BufferedWriter)3 FileWriter (java.io.FileWriter)3 StarTreePlugin (io.hetu.core.cube.startree.StarTreePlugin)2 HetuFileSystemClientPlugin (io.hetu.core.filesystem.HetuFileSystemClientPlugin)2 Session (io.prestosql.Session)2 HiveIdentity (io.prestosql.plugin.hive.authentication.HiveIdentity)2 NoHdfsAuthentication (io.prestosql.plugin.hive.authentication.NoHdfsAuthentication)2 FileHiveMetastore (io.prestosql.plugin.hive.metastore.file.FileHiveMetastore)2 SelectedRole (io.prestosql.spi.security.SelectedRole)2 TestingPrestoClient (io.prestosql.tests.TestingPrestoClient)2 URL (java.net.URL)2