Search in sources :

Example 6 with TpchPlugin

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

the class TestCachedSqlQueryExecution method setupWithExecutionPlanCacheEnabled.

private void setupWithExecutionPlanCacheEnabled(Session session) throws Exception {
    Map<String, String> properties = new HashMap<>();
    properties.putIfAbsent("hetu.executionplan.cache.enabled", "true");
    properties.putIfAbsent("hetu.executionplan.cache.limit", "2");
    properties.putIfAbsent("hetu.executionplan.cache.timeout", "60000");
    if (queryRunner != null) {
        queryRunner.close();
    }
    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)

Example 7 with TpchPlugin

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

the class TestDataCenterClient method setup.

/**
 * setup
 *
 * @throws Exception setup failed.
 */
@BeforeClass
public void setup() throws Exception {
    this.server = new TestingPrestoServer();
    this.baseUri = server.getBaseUrl();
    this.server.installPlugin(new TpchPlugin());
    this.server.createCatalog("tpch", "tpch");
    this.config = new DataCenterConfig().setConnectionUrl(this.baseUri).setConnectionUser("root");
    this.httpClient = DataCenterStatementClientFactory.newHttpClient(this.config);
}
Also used : TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 8 with TpchPlugin

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

the class DataCenterQueryRunner method createDCQueryRunner.

static QueryRunner createDCQueryRunner(TestingPrestoServer hetuServer, Map<String, String> properties, Iterable<TpchTable<?>> tables) throws Exception {
    hetuServer.installPlugin(new TpchPlugin());
    hetuServer.createCatalog("tpch", "tpch");
    DistributedQueryRunner queryRunner = null;
    try {
        DistributedQueryRunner.Builder builder = DistributedQueryRunner.builder(createSession());
        queryRunner = builder.build();
        Map<String, String> connectorProperties = new HashMap<>(properties);
        connectorProperties.putIfAbsent("connection-url", hetuServer.getBaseUrl().toString());
        connectorProperties.putIfAbsent("connection-user", "root");
        queryRunner.installPlugin(new DataCenterPlugin());
        queryRunner.createDCCatalog("dc", "dc", connectorProperties);
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch", properties);
        return queryRunner;
    } catch (Throwable e) {
        closeAllSuppress(e, queryRunner);
        throw e;
    }
}
Also used : DistributedQueryRunner(io.prestosql.tests.DistributedQueryRunner) HashMap(java.util.HashMap) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 9 with TpchPlugin

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

the class GreenPlumQueryRunner method createGreenPlumQueryRunner.

public static QueryRunner createGreenPlumQueryRunner(TestingPostgreSqlServer server, Map<String, String> connectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
    DistributedQueryRunner queryRunner = null;
    try {
        queryRunner = new DistributedQueryRunner(createSession(), 3);
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        Map<String, String> connectorPropertiesMap = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
        connectorPropertiesMap.putIfAbsent("connection-url", server.getJdbcUrl());
        connectorPropertiesMap.putIfAbsent("allow-drop-table", "true");
        connectorPropertiesMap.putIfAbsent("jdbc.pushdown-enabled", "false");
        createSchema(server.getJdbcUrl(), "tpch");
        queryRunner.installPlugin(new GreenPlumSqlPlugin());
        queryRunner.createCatalog(GREENPLUM_CONNECTOR_NAME, GREENPLUM_CONNECTOR_NAME, connectorPropertiesMap);
        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) HashMap(java.util.HashMap) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin)

Example 10 with TpchPlugin

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

the class JdbcQueryRunner method createJdbcQueryRunner.

public static DistributedQueryRunner createJdbcQueryRunner(Iterable<TpchTable<?>> tables) throws Exception {
    DistributedQueryRunner queryRunner = null;
    try {
        queryRunner = new DistributedQueryRunner(createSession(), 3);
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        Map<String, String> properties = TestingH2JdbcModule.createProperties();
        createSchema(properties, "tpch");
        queryRunner.installPlugin(new JdbcPlugin("base-jdbc", new TestingH2JdbcModule()));
        queryRunner.createCatalog("jdbc", "base-jdbc", properties);
        copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
        return queryRunner;
    } catch (Throwable e) {
        closeAllSuppress(e, queryRunner);
        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