use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class TestPruneIndexSourceColumns method buildProjectedIndexSource.
private static PlanNode buildProjectedIndexSource(PlanBuilder p, Predicate<Symbol> projectionFilter) {
Symbol orderkey = p.symbol("orderkey", INTEGER);
Symbol custkey = p.symbol("custkey", INTEGER);
Symbol totalprice = p.symbol("totalprice", DOUBLE);
ColumnHandle orderkeyHandle = new TpchColumnHandle(orderkey.getName(), INTEGER);
ColumnHandle custkeyHandle = new TpchColumnHandle(custkey.getName(), INTEGER);
ColumnHandle totalpriceHandle = new TpchColumnHandle(totalprice.getName(), DOUBLE);
return p.project(Assignments.copyOf(ImmutableList.of(orderkey, custkey, totalprice).stream().filter(projectionFilter).collect(Collectors.toMap(v -> v, v -> p.variable(v.getName())))), p.indexSource(new TableHandle(new CatalogName("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TpchTransactionHandle.INSTANCE, Optional.empty()), ImmutableSet.of(orderkey, custkey), ImmutableList.of(orderkey, custkey, totalprice), ImmutableMap.of(orderkey, orderkeyHandle, custkey, custkeyHandle, totalprice, totalpriceHandle), TupleDomain.fromFixedValues(ImmutableMap.of(totalpriceHandle, asNull(DOUBLE)))));
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class TestProcedureCall method setUp.
@BeforeClass
public void setUp() {
TestingPrestoServer coordinator = ((DistributedQueryRunner) getQueryRunner()).getCoordinator();
tester = coordinator.getProcedureTester();
// register procedures in the bogus testing catalog
ProcedureRegistry procedureRegistry = coordinator.getMetadata().getProcedureRegistry();
TestingProcedures procedures = new TestingProcedures(coordinator.getProcedureTester());
procedureRegistry.addProcedures(new CatalogName(TESTING_CATALOG), procedures.getProcedures(PROCEDURE_SCHEMA));
session = testSessionBuilder().setCatalog(TESTING_CATALOG).setSchema(PROCEDURE_SCHEMA).build();
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class TestQueryPlanDeterminism method createLocalQueryRunner.
private static LocalQueryRunner createLocalQueryRunner() {
Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession);
// add the tpch catalog
// local queries run directly against the generator
localQueryRunner.createCatalog(defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
localQueryRunner.getMetadata().getFunctionAndTypeManager().registerBuiltInFunctions(CUSTOM_FUNCTIONS);
SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager();
sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
sessionPropertyManager.addConnectorSessionProperties(new CatalogName(TESTING_CATALOG), TEST_CATALOG_PROPERTIES);
return localQueryRunner;
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class TestTransactionManager method registerConnector.
private static void registerConnector(CatalogManager catalogManager, TransactionManager transactionManager, String catalogName, CatalogName catalog, Connector connector) {
CatalogName systemId = createSystemTablesCatalogName(catalog);
InternalNodeManager nodeManager = new InMemoryNodeManager();
Metadata metadata = createTestMetadataManager(catalogManager);
catalogManager.registerCatalog(new Catalog(catalogName, catalog, connector, createInformationSchemaCatalogName(catalog), new InformationSchemaConnector(catalogName, nodeManager, metadata, new AllowAllAccessControl()), systemId, new SystemConnector(nodeManager, connector.getSystemTables(), transactionId -> transactionManager.getConnectorTransaction(transactionId, catalog))));
}
use of io.prestosql.spi.connector.CatalogName in project hetu-core by openlookeng.
the class StandaloneQueryRunner method createCatalog.
@Override
public void createCatalog(String catalogName, String connectorName, Map<String, String> properties) {
CatalogName catalog = server.createCatalog(catalogName, connectorName, properties);
refreshNodes(catalog);
}
Aggregations