Search in sources :

Example 1 with TpcdsConnectorFactory

use of io.trino.plugin.tpcds.TpcdsConnectorFactory in project trino by trinodb.

the class TestTpcdsCostBasedPlan 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";
    Session.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 TpcdsConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpcdsConnectorFactory(io.trino.plugin.tpcds.TpcdsConnectorFactory) LocalQueryRunner(io.trino.testing.LocalQueryRunner) Session(io.trino.Session)

Example 2 with TpcdsConnectorFactory

use of io.trino.plugin.tpcds.TpcdsConnectorFactory in project trino by trinodb.

the class TestTpcdsLocalStats method setUp.

@BeforeClass
public void setUp() {
    Session defaultSession = testSessionBuilder().setCatalog("tpcds").setSchema("sf1").setSystemProperty(COLLECT_PLAN_STATISTICS_FOR_ALL_QUERIES, "true").build();
    LocalQueryRunner queryRunner = LocalQueryRunner.create(defaultSession);
    queryRunner.createCatalog("tpcds", new TpcdsConnectorFactory(), emptyMap());
    statisticsAssertion = new StatisticsAssertion(queryRunner);
}
Also used : TpcdsConnectorFactory(io.trino.plugin.tpcds.TpcdsConnectorFactory) StatisticsAssertion(io.trino.testing.statistics.StatisticsAssertion) LocalQueryRunner(io.trino.testing.LocalQueryRunner) Session(io.trino.Session) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

Session (io.trino.Session)2 TpcdsConnectorFactory (io.trino.plugin.tpcds.TpcdsConnectorFactory)2 LocalQueryRunner (io.trino.testing.LocalQueryRunner)2 StatisticsAssertion (io.trino.testing.statistics.StatisticsAssertion)1 BeforeClass (org.testng.annotations.BeforeClass)1