use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class BasePlanTest method createQueryRunner.
private static LocalQueryRunner createQueryRunner(Map<String, String> sessionProperties) {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("local").setSchema("tiny").setSystemProperty("task_concurrency", // these tests don't handle exchanges from local parallel
"1");
sessionProperties.entrySet().forEach(entry -> sessionBuilder.setSystemProperty(entry.getKey(), entry.getValue()));
LocalQueryRunner localQueryRunner = new LocalQueryRunner(sessionBuilder.build());
localQueryRunner.createCatalog(localQueryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
return localQueryRunner;
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestTransactionManager method testAbortedTransactionWorkflow.
@Test
public void testAbortedTransactionWorkflow() {
try (IdleCheckExecutor executor = new IdleCheckExecutor()) {
CatalogManager catalogManager = new CatalogManager();
TransactionManager transactionManager = InMemoryTransactionManager.create(new TransactionManagerConfig(), executor.getExecutor(), catalogManager, finishingExecutor);
Connector c1 = new TpchConnectorFactory().create(CATALOG, ImmutableMap.of(), new TestingConnectorContext());
registerConnector(catalogManager, transactionManager, CATALOG, CATALOG_NAME, c1);
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();
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.asyncAbort(transactionId));
assertTrue(transactionManager.getAllTransactionInfos().isEmpty());
}
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestRowFilter method init.
@BeforeClass
public void init() {
LocalQueryRunner runner = new LocalQueryRunner(SESSION);
runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
ConnectorViewDefinition view = new ConnectorViewDefinition("SELECT nationkey, name FROM local.tiny.nation", Optional.empty(), Optional.empty(), ImmutableList.of(new ConnectorViewDefinition.ViewColumn("nationkey", BigintType.BIGINT.getTypeSignature()), new ConnectorViewDefinition.ViewColumn("name", VarcharType.createVarcharType(25).getTypeSignature())), Optional.of(VIEW_OWNER), false);
MockConnectorFactory mock = MockConnectorFactory.builder().withGetViews((s, prefix) -> ImmutableMap.<SchemaTableName, ConnectorViewDefinition>builder().put(new SchemaTableName("default", "nation_view"), view).build()).build();
runner.createCatalog(MOCK_CATALOG, mock, ImmutableMap.of());
assertions = new QueryAssertions(runner);
accessControl = assertions.getQueryRunner().getAccessControl();
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestHiddenColumns method setUp.
@BeforeClass
public void setUp() {
runner = new LocalQueryRunner(TEST_SESSION);
runner.createCatalog(TEST_SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class MemoryLocalQueryRunner method createMemoryLocalQueryRunner.
private static LocalQueryRunner createMemoryLocalQueryRunner(Session session) {
LocalQueryRunner queryRunnerWithInitialTransaction = LocalQueryRunner.queryRunnerWithInitialTransaction(session);
// add tpch
queryRunnerWithInitialTransaction.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
queryRunnerWithInitialTransaction.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of("memory.max-data-per-node", "4GB"));
return queryRunnerWithInitialTransaction;
}
Aggregations