public EPPreparedExecuteSingleStreamUpdate(StatementSpecCompiled statementSpec, EPServicesContext services, StatementContext statementContext) throws ExprValidationException {
super(statementSpec, services, statementContext);
}
public EPPreparedExecuteSingleStreamExec getExecutor(FilterSpecCompiled filter, String aliasName) {
FireAndForgetSpecUpdate updateSpec = (FireAndForgetSpecUpdate) statementSpec.getFireAndForgetSpec();
StreamTypeServiceImpl assignmentTypeService = new StreamTypeServiceImpl(
new EventType[] {processor.getNamedWindowType(), null, processor.getNamedWindowType()},
new String[] {aliasName, "", EPStatementStartMethodOnTrigger.INITIAL_VALUE_STREAM_NAME},
new boolean[] {true, true, true}, services.getEngineURI(), true);
assignmentTypeService.setStreamZeroUnambigous(true);
ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
ExprValidationContext validationContext = new ExprValidationContext(assignmentTypeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), false, false);
// validate update expressions
try {
for (OnTriggerSetAssignment assignment : updateSpec.getAssignments())
{
ExprNode validated = ExprNodeUtility.getValidatedSubtree(ExprNodeOrigin.UPDATEASSIGN, assignment.getExpression(), validationContext);
assignment.setExpression(validated);
EPStatementStartMethodHelperValidate.validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
}
}
catch (ExprValidationException e) {
throw new EPException(e.getMessage(), e);
}
// make updater
NamedWindowUpdateHelper updateHelper;
try {
updateHelper = NamedWindowUpdateHelper.make(processor.getNamedWindowName(),
(EventTypeSPI) processor.getNamedWindowType(), updateSpec.getAssignments(), aliasName, null);
}
catch (ExprValidationException e) {
throw new EPException(e.getMessage(), e);
}