use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestIterativeOptimizer method setUp.
@BeforeClass
public void setUp() {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("local").setSchema("tiny").setSystemProperty("task_concurrency", "1").setSystemProperty("iterative_optimizer_timeout", "1ms");
queryRunner = LocalQueryRunner.create(sessionBuilder.build());
queryRunner.createCatalog(queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class BasePlanTest method createLocalQueryRunner.
// Subclasses should implement this method to inject their own query runners
protected LocalQueryRunner createLocalQueryRunner() {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("local").setSchema("tiny").setSystemProperty("task_concurrency", // these tests don't handle exchanges from local parallel
"1");
sessionProperties.forEach(sessionBuilder::setSystemProperty);
LocalQueryRunner queryRunner = LocalQueryRunner.create(sessionBuilder.build());
queryRunner.createCatalog(queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
return queryRunner;
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestTransactionManager method testTransactionWorkflow.
@Test
public void testTransactionWorkflow() {
try (LocalQueryRunner queryRunner = LocalQueryRunner.create(TEST_SESSION)) {
TransactionManager transactionManager = queryRunner.getTransactionManager();
queryRunner.createCatalog(CATALOG, new TpchConnectorFactory(), ImmutableMap.of());
TransactionId transactionId = transactionManager.beginTransaction(false);
assertEquals(transactionManager.getAllTransactionInfos().size(), 1);
TransactionInfo transactionInfo = transactionManager.getTransactionInfo(transactionId);
assertFalse(transactionInfo.isAutoCommitContext());
assertTrue(transactionInfo.getCatalogNames().isEmpty());
assertFalse(transactionInfo.getWrittenConnectorId().isPresent());
ConnectorMetadata metadata = transactionManager.getOptionalCatalogMetadata(transactionId, CATALOG).get().getMetadata(TEST_SESSION);
metadata.listSchemaNames(TEST_SESSION.toConnectorSession(CATALOG_NAME));
transactionInfo = transactionManager.getTransactionInfo(transactionId);
assertEquals(transactionInfo.getCatalogNames(), ImmutableList.of(CATALOG_NAME, INFORMATION_SCHEMA_ID, SYSTEM_TABLES_ID));
assertFalse(transactionInfo.getWrittenConnectorId().isPresent());
getFutureValue(transactionManager.asyncCommit(transactionId));
assertTrue(transactionManager.getAllTransactionInfos().isEmpty());
}
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestWith method init.
@BeforeAll
public void init() {
Session session = testSessionBuilder().setCatalog(CATALOG).setSchema(TINY_SCHEMA_NAME).build();
LocalQueryRunner runner = LocalQueryRunner.builder(session).build();
runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
assertions = new QueryAssertions(runner);
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class StatsCalculatorTester method createQueryRunner.
private static LocalQueryRunner createQueryRunner(Session session) {
LocalQueryRunner queryRunner = LocalQueryRunner.create(session);
queryRunner.createCatalog(session.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
return queryRunner;
}
Aggregations