use of org.teiid.query.sql.lang.ProcedureContainer in project teiid by teiid.
the class ProcedureContainerResolver method resolveCommand.
/**
* @see org.teiid.query.resolver.CommandResolver#resolveCommand(org.teiid.query.sql.lang.Command, org.teiid.query.metadata.TempMetadataAdapter, boolean)
*/
public void resolveCommand(Command command, TempMetadataAdapter metadata, boolean resolveNullLiterals) throws QueryMetadataException, QueryResolverException, TeiidComponentException {
ProcedureContainer procCommand = (ProcedureContainer) command;
resolveGroup(metadata, procCommand);
resolveProceduralCommand(procCommand, metadata);
// getPlan(metadata, procCommand);
}
use of org.teiid.query.sql.lang.ProcedureContainer in project teiid by teiid.
the class DataTierTupleSource method checkForUpdates.
private void checkForUpdates(AtomicResultsMessage results, Command command, EventDistributor distributor, int commandIndex, long ts) {
if (!RelationalNodeUtil.isUpdate(command) || !(command instanceof ProcedureContainer)) {
return;
}
ProcedureContainer pc = (ProcedureContainer) command;
GroupSymbol gs = pc.getGroup();
Integer zero = Integer.valueOf(0);
if (results.getResults().length <= commandIndex || zero.equals(results.getResults()[commandIndex].get(0))) {
return;
}
Object metadataId = gs.getMetadataID();
if (metadataId == null) {
return;
}
if (!(metadataId instanceof Table)) {
if (metadataId instanceof TempMetadataID) {
TempMetadataID tid = (TempMetadataID) metadataId;
if (tid.getTableData().getModel() != null) {
tid.getTableData().dataModified((Integer) results.getResults()[commandIndex].get(0));
}
}
return;
}
Table t = (Table) metadataId;
t.setLastDataModification(ts);
if (distributor != null) {
distributor.dataModification(this.workItem.getDqpWorkContext().getVdbName(), this.workItem.getDqpWorkContext().getVdbVersion(), t.getParent().getName(), t.getName());
}
}
use of org.teiid.query.sql.lang.ProcedureContainer in project teiid by teiid.
the class TestProcedureResolving method resolveProcedure.
private Command resolveProcedure(String userUpdateStr, QueryMetadataInterface metadata) throws QueryParserException, QueryResolverException, TeiidComponentException, QueryMetadataException {
ProcedureContainer userCommand = (ProcedureContainer) QueryParser.getQueryParser().parseCommand(userUpdateStr);
QueryResolver.resolveCommand(userCommand, metadata);
metadata = new TempMetadataAdapter(metadata, userCommand.getTemporaryMetadata());
return QueryResolver.expandCommand(userCommand, metadata, null);
}
use of org.teiid.query.sql.lang.ProcedureContainer in project teiid by teiid.
the class TestValidator method validateProcedure.
private void validateProcedure(String userUpdateStr, QueryMetadataInterface metadata) throws QueryResolverException, QueryMetadataException, TeiidComponentException, QueryValidatorException {
ProcedureContainer command = (ProcedureContainer) helpResolve(userUpdateStr, metadata);
Command proc = QueryResolver.expandCommand(command, metadata, AnalysisRecord.createNonRecordingRecord());
ValidatorReport report = Validator.validate(proc, metadata);
if (report.hasItems()) {
throw new QueryValidatorException(report.getFailureMessage());
}
report = Validator.validate(command, metadata);
if (report.hasItems()) {
throw new QueryValidatorException(report.getFailureMessage());
}
}
Aggregations