use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class RaptorBenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner() {
Session session = testSessionBuilder().setCatalog("raptor").setSchema("benchmark").build();
LocalQueryRunner localQueryRunner = LocalQueryRunner.create(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
// add raptor
ConnectorFactory raptorConnectorFactory = getOnlyElement(new RaptorPlugin().getConnectorFactories());
Map<String, String> config = createRaptorConfig(TPCH_CACHE_DIR);
localQueryRunner.createCatalog("raptor", raptorConnectorFactory, config);
if (!localQueryRunner.tableExists(session, "orders")) {
localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders");
}
if (!localQueryRunner.tableExists(session, "lineitem")) {
localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem");
}
return localQueryRunner;
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestTpchCostBasedPlan method createLocalQueryRunner.
/*
* CAUTION: The expected plans here are not necessarily optimal yet. Their role is to prevent
* inadvertent regressions. A conscious improvement to the planner may require changing some
* of the expected plans, but any such change should be verified on an actual cluster with
* large amount of data.
*/
@Override
protected LocalQueryRunner createLocalQueryRunner() {
String catalog = "local";
SessionBuilder sessionBuilder = testSessionBuilder().setCatalog(catalog).setSchema("sf3000.0").setSystemProperty("task_concurrency", // these tests don't handle exchanges from local parallel
"1").setSystemProperty(JOIN_REORDERING_STRATEGY, JoinReorderingStrategy.AUTOMATIC.name()).setSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.AUTOMATIC.name());
LocalQueryRunner queryRunner = LocalQueryRunner.builder(sessionBuilder.build()).withNodeCountForStats(8).build();
queryRunner.createCatalog(catalog, new TpchConnectorFactory(1, false, false), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.SIMPLIFIED.name()));
return queryRunner;
}
use of io.trino.plugin.tpch.TpchConnectorFactory 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;
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestQuerySpillLimits method createLocalQueryRunner.
private LocalQueryRunner createLocalQueryRunner(NodeSpillConfig nodeSpillConfig) {
LocalQueryRunner queryRunner = LocalQueryRunner.builder(SESSION).withFeaturesConfig(new FeaturesConfig().setSpillerSpillPaths(spillPath.getAbsolutePath()).setSpillEnabled(true)).withNodeSpillConfig(nodeSpillConfig).withAlwaysRevokeMemory().build();
queryRunner.createCatalog(SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
return queryRunner;
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestTpchLocalStats method setUp.
@BeforeClass
public void setUp() {
Session defaultSession = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME).setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false").setSystemProperty(COLLECT_PLAN_STATISTICS_FOR_ALL_QUERIES, "true").build();
LocalQueryRunner queryRunner = LocalQueryRunner.create(defaultSession);
queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name()));
statisticsAssertion = new StatisticsAssertion(queryRunner);
}
Aggregations