Search in sources :

Example 1 with MemoryConnectorFactory

use of io.trino.plugin.memory.MemoryConnectorFactory in project trino by trinodb.

the class TestSpatialJoinPlanning method createLocalQueryRunner.

@Override
protected LocalQueryRunner createLocalQueryRunner() {
    LocalQueryRunner queryRunner = LocalQueryRunner.create(testSessionBuilder().setCatalog("memory").setSchema("default").build());
    queryRunner.installPlugin(new GeoPlugin());
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of());
    queryRunner.execute(format("CREATE TABLE kdb_tree AS SELECT '%s' AS v", KDB_TREE_JSON));
    queryRunner.execute("CREATE TABLE points (lng, lat, name) AS (VALUES (2.1e0, 2.1e0, 'x'))");
    queryRunner.execute("CREATE TABLE polygons (wkt, name) AS (VALUES ('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))', 'a'))");
    return queryRunner;
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) MemoryConnectorFactory(io.trino.plugin.memory.MemoryConnectorFactory) LocalQueryRunner(io.trino.testing.LocalQueryRunner)

Example 2 with MemoryConnectorFactory

use of io.trino.plugin.memory.MemoryConnectorFactory in project trino by trinodb.

the class MemoryLocalQueryRunner method createMemoryLocalQueryRunner.

private static LocalQueryRunner createMemoryLocalQueryRunner(Session session) {
    LocalQueryRunner localQueryRunner = LocalQueryRunner.builder(session).withInitialTransaction().build();
    // add tpch
    localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    localQueryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of("memory.max-data-per-node", "4GB"));
    return localQueryRunner;
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) MemoryConnectorFactory(io.trino.plugin.memory.MemoryConnectorFactory) LocalQueryRunner(io.trino.testing.LocalQueryRunner)

Aggregations

MemoryConnectorFactory (io.trino.plugin.memory.MemoryConnectorFactory)2 TpchConnectorFactory (io.trino.plugin.tpch.TpchConnectorFactory)2 LocalQueryRunner (io.trino.testing.LocalQueryRunner)2