return explainer.getGraphvizPlan(SqlParser.createStatement(query), planType);
}
private QueryExplainer getQueryExplainer()
{
MetadataManager metadata = new MetadataManager(new FeaturesConfig().setExperimentalSyntaxEnabled(true), new TypeRegistry());
metadata.addGlobalSchemaMetadata(DualConnector.CONNECTOR_ID, new DualMetadata());
SplitManager splitManager = new SplitManager();
splitManager.addConnectorSplitManager(DualConnector.CONNECTOR_ID, new DualSplitManager(new InMemoryNodeManager()));
IndexManager indexManager = new IndexManager();
FeaturesConfig featuresConfig = new FeaturesConfig().setExperimentalSyntaxEnabled(true);
List<PlanOptimizer> optimizers = new PlanOptimizersFactory(metadata, splitManager, indexManager, featuresConfig).get();
return new QueryExplainer(session, optimizers, metadata, featuresConfig.isExperimentalSyntaxEnabled());
}