use of io.prestosql.metadata.MetadataManager in project hetu-core by openlookeng.
the class DataCenterUtility method loadDCCatalogForQueryFlow.
/**
* Utility method to load DC catalog from query flow.
*
* @param session session
* @param metadata metadata
*/
public static void loadDCCatalogForQueryFlow(Session session, Metadata metadata, String catalogName) {
if (!catalogName.contains(".")) {
return;
}
MetadataManager metadataManager = (MetadataManager) metadata;
DataCenterConnectorManager dataCenterConnectorManager = metadataManager.getDataCenterConnectorManager();
if (dataCenterConnectorManager != null) {
dataCenterConnectorManager.loadDCCatalog(catalogName);
}
}
use of io.prestosql.metadata.MetadataManager in project hetu-core by openlookeng.
the class TestMetadataManager method setUp.
@BeforeClass
public void setUp() throws Exception {
queryRunner = TpchQueryRunnerBuilder.builder().build();
queryRunner.installPlugin(new Plugin() {
@Override
public Iterable<ConnectorFactory> getConnectorFactories() {
MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")).withListTables((session, schemaNameOrNull) -> {
throw new UnsupportedOperationException();
}).withGetViews((session, prefix) -> ImmutableMap.of()).withGetColumnHandles((session, tableHandle) -> {
throw new UnsupportedOperationException();
}).build();
return ImmutableList.of(connectorFactory);
}
});
queryRunner.createCatalog("upper_case_schema_catalog", "mock");
metadataManager = (MetadataManager) queryRunner.getMetadata();
}
Aggregations