if (command.getType() == Command.TYPE_QUERY && command instanceof Query && QueryResolver.isXMLQuery((Query)command, metadata)) {
result = XML_PLANNER.optimize(command, idGenerator, metadata, capFinder, analysisRecord, context);
} else {
RelationalPlanner planner = new RelationalPlanner();
planner.initialize(command, idGenerator, metadata, capFinder, analysisRecord, context);
result = planner.optimize(command);
}
} catch (QueryResolverException e) {
throw new TeiidRuntimeException(e);
}
}