return explainer.getGraphvizPlan((Query) SqlParser.createStatement(query), planType);
}
private static QueryExplainer getQueryExplainer()
{
Session session = new Session("user", "test", DEFAULT_CATALOG, DEFAULT_SCHEMA, null, null);
MetadataManager metadata = new MetadataManager();
metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, new DualMetadata());
SplitManager splitManager = new SplitManager(ImmutableSet.<ConnectorSplitManager>of(new DualSplitManager(new InMemoryNodeManager())));
List<PlanOptimizer> optimizers = new PlanOptimizersFactory(metadata, splitManager).get();
return new QueryExplainer(session, optimizers, metadata, new MockPeriodicImportManager(), new MockStorageManager());