Search in sources :

Example 11 with TpchConnectorFactory

use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.

the class TestDictionaryAggregation method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() {
    LocalQueryRunner queryRunner = LocalQueryRunner.create(testSessionBuilder().setSystemProperty(DICTIONARY_AGGREGATION, "true").setSystemProperty(JOIN_REORDERING_STRATEGY, NONE.toString()).build());
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) LocalQueryRunner(io.trino.testing.LocalQueryRunner)

Example 12 with TpchConnectorFactory

use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.

the class TestTablesample method setUp.

@BeforeClass
public void setUp() throws Exception {
    queryRunner = LocalQueryRunner.create(TEST_SESSION);
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    assertions = new QueryAssertions(queryRunner);
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) QueryAssertions(io.trino.sql.query.QueryAssertions) BeforeClass(org.testng.annotations.BeforeClass)

Example 13 with TpchConnectorFactory

use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.

the class TestQueryPlanDeterminism method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() {
    Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).build();
    LocalQueryRunner localQueryRunner = LocalQueryRunner.builder(defaultSession).build();
    // add the tpch catalog
    // local queries run directly against the generator
    localQueryRunner.createCatalog(defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
    localQueryRunner.addFunctions(CUSTOM_FUNCTIONS);
    return localQueryRunner;
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) LocalQueryRunner(io.trino.testing.LocalQueryRunner) Session(io.trino.Session)

Example 14 with TpchConnectorFactory

use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.

the class TestAddExchangesPlans method createLocalQueryRunner.

@Override
protected LocalQueryRunner createLocalQueryRunner() {
    Session session = testSessionBuilder().setCatalog("tpch").setSchema("tiny").build();
    FeaturesConfig featuresConfig = new FeaturesConfig().setSpillerSpillPaths("/tmp/test_spill_path");
    LocalQueryRunner queryRunner = LocalQueryRunner.builder(session).withFeaturesConfig(featuresConfig).build();
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) FeaturesConfig(io.trino.FeaturesConfig) LocalQueryRunner(io.trino.testing.LocalQueryRunner) Session(io.trino.Session)

Example 15 with TpchConnectorFactory

use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.

the class TestMemoryPools method setUp.

private void setUp(Supplier<List<Driver>> driversSupplier) {
    checkState(localQueryRunner == null, "Already set up");
    Session session = testSessionBuilder().setCatalog("tpch").setSchema("tiny").setSystemProperty("task_default_concurrency", "1").build();
    localQueryRunner = LocalQueryRunner.builder(session).withInitialTransaction().build();
    // add tpch
    localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    userPool = new MemoryPool(TEN_MEGABYTES);
    fakeQueryId = new QueryId("fake");
    SpillSpaceTracker spillSpaceTracker = new SpillSpaceTracker(DataSize.of(1, GIGABYTE));
    QueryContext queryContext = new QueryContext(new QueryId("query"), TEN_MEGABYTES, userPool, new TestingGcMonitor(), localQueryRunner.getExecutor(), localQueryRunner.getScheduler(), TEN_MEGABYTES, spillSpaceTracker);
    taskContext = createTaskContext(queryContext, localQueryRunner.getExecutor(), localQueryRunner.getDefaultSession());
    drivers = driversSupplier.get();
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) SpillSpaceTracker(io.trino.spiller.SpillSpaceTracker) QueryId(io.trino.spi.QueryId) TestingGcMonitor(io.airlift.stats.TestingGcMonitor) Session(io.trino.Session)

Aggregations

TpchConnectorFactory (io.trino.plugin.tpch.TpchConnectorFactory)31 LocalQueryRunner (io.trino.testing.LocalQueryRunner)25 Session (io.trino.Session)17 BeforeClass (org.testng.annotations.BeforeClass)7 TestingSession.testSessionBuilder (io.trino.testing.TestingSession.testSessionBuilder)5 BeforeAll (org.junit.jupiter.api.BeforeAll)5 ImmutableList (com.google.common.collect.ImmutableList)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 FeaturesConfig (io.trino.FeaturesConfig)3 ConnectorMetadata (io.trino.spi.connector.ConnectorMetadata)3 Optional (java.util.Optional)3 Test (org.testng.annotations.Test)3 SessionBuilder (io.trino.Session.SessionBuilder)2 TPCH_NATION_WITH_HIDDEN_COLUMN (io.trino.connector.MockConnectorEntities.TPCH_NATION_WITH_HIDDEN_COLUMN)2 TPCH_WITH_HIDDEN_COLUMN_DATA (io.trino.connector.MockConnectorEntities.TPCH_WITH_HIDDEN_COLUMN_DATA)2 MockConnectorFactory (io.trino.connector.MockConnectorFactory)2 QualifiedObjectName (io.trino.metadata.QualifiedObjectName)2 MemoryConnectorFactory (io.trino.plugin.memory.MemoryConnectorFactory)2 TINY_SCHEMA_NAME (io.trino.plugin.tpch.TpchMetadata.TINY_SCHEMA_NAME)2 ConnectorViewDefinition (io.trino.spi.connector.ConnectorViewDefinition)2