Search in sources :

Example 16 with TpchPlugin

use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.

the class TestBeginQuery method setUp.

@BeforeClass
public void setUp() throws Exception {
    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(com.facebook.presto.tpch.TpchPlugin) BeforeClass(org.testng.annotations.BeforeClass)

Example 17 with TpchPlugin

use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.

the class TestEventListener method setUp.

@BeforeClass
private void setUp() throws Exception {
    session = testSessionBuilder().setSystemProperty("task_concurrency", "1").setCatalog("tpch").setSchema("tiny").setClientInfo("{\"clientVersion\":\"testVersion\"}").build();
    queryRunner = new DistributedQueryRunner(session, 1);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of("tpch.splits-per-node", Integer.toString(SPLITS_PER_NODE)));
}
Also used : TestingEventListenerPlugin(com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) BeforeClass(org.testng.annotations.BeforeClass)

Example 18 with TpchPlugin

use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.

the class TestQueues method createQueryRunner.

private static DistributedQueryRunner createQueryRunner(Map<String, String> properties) throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder().build(), 2, ImmutableMap.of(), properties, new SqlParserOptions());
    try {
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : SqlParserOptions(com.facebook.presto.sql.parser.SqlParserOptions) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin)

Example 19 with TpchPlugin

use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.

the class TestQueues method createQueryRunner.

private static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao) throws Exception {
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
    builder.put("experimental.resource-groups-enabled", "true");
    Map<String, String> properties = builder.build();
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder().build(), 2, ImmutableMap.of(), properties, new SqlParserOptions());
    try {
        Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
        queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
        queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(NAME, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl));
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        setup(queryRunner, dao);
        return queryRunner;
    } catch (Exception e) {
        queryRunner.close();
        throw e;
    }
}
Also used : SqlParserOptions(com.facebook.presto.sql.parser.SqlParserOptions) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) ImmutableMap(com.google.common.collect.ImmutableMap) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) Plugin(com.facebook.presto.spi.Plugin)

Example 20 with TpchPlugin

use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.

the class RedisQueryRunner method createRedisQueryRunner.

public static DistributedQueryRunner createRedisQueryRunner(EmbeddedRedis embeddedRedis, String dataFormat, Iterable<TpchTable<?>> tables) throws Exception {
    DistributedQueryRunner queryRunner = null;
    try {
        queryRunner = new DistributedQueryRunner(createSession(), 2);
        queryRunner.installPlugin(new TpchPlugin());
        queryRunner.createCatalog("tpch", "tpch");
        embeddedRedis.start();
        Map<SchemaTableName, RedisTableDescription> tableDescriptions = createTpchTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables, dataFormat);
        installRedisPlugin(embeddedRedis, queryRunner, tableDescriptions);
        TestingPrestoClient prestoClient = queryRunner.getClient();
        log.info("Loading data...");
        long startTime = System.nanoTime();
        for (TpchTable<?> table : tables) {
            loadTpchTable(embeddedRedis, prestoClient, table, dataFormat);
        }
        log.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS));
        embeddedRedis.destroyJedisPool();
        return queryRunner;
    } catch (Throwable e) {
        closeAllSuppress(e, queryRunner, embeddedRedis);
        throw e;
    }
}
Also used : TestingPrestoClient(com.facebook.presto.tests.TestingPrestoClient) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) SchemaTableName(com.facebook.presto.spi.SchemaTableName)

Aggregations

TpchPlugin (com.facebook.presto.tpch.TpchPlugin)20 DistributedQueryRunner (com.facebook.presto.tests.DistributedQueryRunner)17 Session (com.facebook.presto.Session)3 SqlParserOptions (com.facebook.presto.sql.parser.SqlParserOptions)3 File (java.io.File)3 BeforeClass (org.testng.annotations.BeforeClass)3 SchemaTableName (com.facebook.presto.spi.SchemaTableName)2 TestingPrestoClient (com.facebook.presto.tests.TestingPrestoClient)2 LexicoderRowSerializer (com.facebook.presto.accumulo.serializers.LexicoderRowSerializer)1 TestingEventListenerPlugin (com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin)1 NoHdfsAuthentication (com.facebook.presto.hive.authentication.NoHdfsAuthentication)1 FileHiveMetastore (com.facebook.presto.hive.metastore.file.FileHiveMetastore)1 BlackHolePlugin (com.facebook.presto.plugin.blackhole.BlackHolePlugin)1 TestingPrestoServer (com.facebook.presto.server.testing.TestingPrestoServer)1 Plugin (com.facebook.presto.spi.Plugin)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 TpchTable (io.airlift.tpch.TpchTable)1 ExecutionException (java.util.concurrent.ExecutionException)1 Text (org.apache.hadoop.io.Text)1