Search in sources :

Example 1 with TpchPlugin

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

the class PostgreSqlQueryRunner method createPostgreSqlQueryRunner.

public static QueryRunner createPostgreSqlQueryRunner(TestingPostgreSqlServer server, Map<String, String> inputConnectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
    Map<String, String> connectorProperties = inputConnectorProperties;
    DistributedQueryRunner queryRunner = null;
    try {
        queryRunner = new DistributedQueryRunner(createSession(), 3);
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        connectorProperties = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
        connectorProperties.putIfAbsent("connection-url", server.getJdbcUrl());
        connectorProperties.putIfAbsent("allow-drop-table", "true");
        createSchema(server.getJdbcUrl(), "tpch");
        queryRunner.installPlugin(new PostgreSqlPlugin());
        queryRunner.createCatalog("postgresql", "postgresql", connectorProperties);
        copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
        return queryRunner;
    } catch (Throwable e) {
        closeAllSuppress(e, queryRunner, server);
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 2 with TpchPlugin

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

the class TestMemoryManager method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(Session session, Map<String, String> properties) throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 2, properties);
    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) ExecutionException(java.util.concurrent.ExecutionException)

Example 3 with TpchPlugin

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

the class TestDistributedSpilledQueries method createQueryRunner.

public static DistributedQueryRunner createQueryRunner() throws Exception {
    Session defaultSession = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME).setSystemProperty(SystemSessionProperties.TASK_CONCURRENCY, "2").setSystemProperty(SystemSessionProperties.SPILL_ENABLED, "true").setSystemProperty(SystemSessionProperties.SPILL_ORDER_BY, "true").setSystemProperty(SystemSessionProperties.AGGREGATION_OPERATOR_UNSPILL_MEMORY_LIMIT, "128kB").build();
    Map<String, String> extraProperties = new HashMap<String, String>();
    extraProperties.put("experimental.spiller-spill-path", Paths.get(System.getProperty("java.io.tmpdir"), "presto", "spills").toString());
    extraProperties.put("experimental.spiller-max-used-space-threshold", "1.0");
    // revoke always
    extraProperties.put("experimental.memory-revoking-threshold", "0.0");
    extraProperties.put("experimental.memory-revoking-target", "0.0");
    extraProperties.put("experimental.spiller-spill-to-hdfs", "false");
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(defaultSession, 2, extraProperties);
    try {
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.installPlugin(new HetuFileSystemClientPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : HetuFileSystemClientPlugin(io.hetu.core.filesystem.HetuFileSystemClientPlugin) HashMap(java.util.HashMap) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) Session(io.prestosql.Session)

Example 4 with TpchPlugin

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

the class TestBeginQuery method setUp.

@BeforeClass
public void setUp() {
    metadata = new TestMetadata();
    getQueryRunner().installPlugin(new TestPlugin(metadata));
    getQueryRunner().installPlugin(new TpchPlugin());
    getQueryRunner().createCatalog("test", "test", ImmutableMap.of());
    getQueryRunner().createCatalog("tpch", "tpch", ImmutableMap.of());
}
Also used : TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with TpchPlugin

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

the class TestDataCenterHTTPClientV1 method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(Session session) throws Exception {
    DistributedQueryRunner distributedQueryRunner = DistributedQueryRunner.builder(session).setNodeCount(2).build();
    try {
        distributedQueryRunner.installPlugin(new TpchPlugin());
        distributedQueryRunner.createCatalog("tpch", "tpch");
        return distributedQueryRunner;
    } catch (Exception e) {
        distributedQueryRunner.close();
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) 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