Search in sources :

Example 11 with TpchPlugin

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

the class TestPrestoDriver method setup.

@BeforeClass
public void setup() throws Exception {
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new TpchPlugin());
    server.createCatalog(TEST_CATALOG, "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
    setupTestTables();
    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));
}
Also used : BlackHolePlugin(com.facebook.presto.plugin.blackhole.BlackHolePlugin) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 12 with TpchPlugin

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

the class AccumuloQueryRunner method createAccumuloQueryRunner.

public static synchronized DistributedQueryRunner createAccumuloQueryRunner(Map<String, String> extraProperties) throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession(), 4, extraProperties);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");
    queryRunner.installPlugin(new AccumuloPlugin());
    Map<String, String> accumuloProperties = ImmutableMap.<String, String>builder().put(AccumuloConfig.INSTANCE, connector.getInstance().getInstanceName()).put(AccumuloConfig.ZOOKEEPERS, connector.getInstance().getZooKeepers()).put(AccumuloConfig.USERNAME, MAC_USER).put(AccumuloConfig.PASSWORD, MAC_PASSWORD).put(AccumuloConfig.ZOOKEEPER_METADATA_ROOT, "/presto-accumulo-test").build();
    queryRunner.createCatalog("accumulo", "accumulo", accumuloProperties);
    if (!tpchLoaded) {
        copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), TpchTable.getTables());
        connector.tableOperations().addSplits("tpch.orders", ImmutableSortedSet.of(new Text(new LexicoderRowSerializer().encode(BIGINT, 7500L))));
        tpchLoaded = true;
    }
    return queryRunner;
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) LexicoderRowSerializer(com.facebook.presto.accumulo.serializers.LexicoderRowSerializer) Text(org.apache.hadoop.io.Text)

Example 13 with TpchPlugin

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

the class RaptorQueryRunner method createRaptorQueryRunner.

public static DistributedQueryRunner createRaptorQueryRunner(Map<String, String> extraProperties, boolean loadTpch, boolean bucketed) throws Exception {
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession("tpch"), 2, extraProperties);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");
    queryRunner.installPlugin(new RaptorPlugin());
    File baseDir = queryRunner.getCoordinator().getBaseDataDir().toFile();
    Map<String, String> raptorProperties = ImmutableMap.<String, String>builder().put("metadata.db.type", "h2").put("metadata.db.connections.max", "100").put("metadata.db.filename", new File(baseDir, "db").getAbsolutePath()).put("storage.data-directory", new File(baseDir, "data").getAbsolutePath()).put("storage.max-shard-rows", "2000").put("backup.provider", "file").put("backup.directory", new File(baseDir, "backup").getAbsolutePath()).build();
    queryRunner.createCatalog("raptor", "raptor", raptorProperties);
    if (loadTpch) {
        copyTables(queryRunner, "tpch", createSession(), bucketed);
    }
    return queryRunner;
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) File(java.io.File)

Example 14 with TpchPlugin

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

the class TpchQueryRunner method createQueryRunner.

public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties, Map<String, String> coordinatorProperties) throws Exception {
    Session session = testSessionBuilder().setSource("test").setCatalog("tpch").setSchema("tiny").build();
    DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 4, extraProperties, coordinatorProperties, 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) Session(com.facebook.presto.Session)

Example 15 with TpchPlugin

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

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(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) ExecutionException(java.util.concurrent.ExecutionException)

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