use of org.teiid.query.validator.AbstractValidationVisitor in project teiid by teiid.
the class QueryProcessorFactoryImpl method getPreparedPlan.
@Override
public PreparedPlan getPreparedPlan(String query, String recursionGroup, CommandContext commandContext, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException {
if (recursionGroup != null) {
commandContext.pushCall(recursionGroup);
}
PreparedPlan pp = commandContext.getPlan(query);
if (pp == null) {
ParseInfo parseInfo = new ParseInfo();
Command newCommand = QueryParser.getQueryParser().parseCommand(query, parseInfo);
QueryResolver.resolveCommand(newCommand, metadata);
List<Reference> references = ReferenceCollectorVisitor.getReferences(newCommand);
AbstractValidationVisitor visitor = new ValidationVisitor();
Request.validateWithVisitor(visitor, metadata, newCommand);
newCommand = QueryRewriter.rewrite(newCommand, metadata, commandContext);
AnalysisRecord record = new AnalysisRecord(false, false);
ProcessorPlan plan = QueryOptimizer.optimizePlan(newCommand, metadata, idGenerator, finder, record, commandContext);
pp = new PreparedPlan();
pp.setPlan(plan, commandContext);
pp.setReferences(references);
pp.setAnalysisRecord(record);
pp.setCommand(newCommand);
commandContext.putPlan(query, pp, commandContext.getDeterminismLevel());
}
return pp;
}
use of org.teiid.query.validator.AbstractValidationVisitor in project teiid by teiid.
the class Request method validateQuery.
private void validateQuery(Command command) throws QueryValidatorException, TeiidComponentException {
// Create generic sql validation visitor
AbstractValidationVisitor visitor = new ValidationVisitor();
validateWithVisitor(visitor, metadata, command);
}
Aggregations