Search in sources :

Example 1 with CompiledExpression

use of io.siddhi.core.util.collection.operator.CompiledExpression in project siddhi by wso2.

the class AbstractRecordTable method compileUpdateSet.

public CompiledUpdateSet compileUpdateSet(UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, SiddhiQueryContext siddhiQueryContext) {
    RecordTableCompiledUpdateSet recordTableCompiledUpdateSet = new RecordTableCompiledUpdateSet();
    Map<String, ExpressionExecutor> parentExecutorMap = new HashMap<>();
    for (UpdateSet.SetAttribute setAttribute : updateSet.getSetAttributeList()) {
        ExpressionExecutor inMemoryAssignmentExecutor = ExpressionParser.parseExpression(setAttribute.getAssignmentExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, false, 0, ProcessingMode.BATCH, false, siddhiQueryContext);
        ExpressionBuilder expressionBuilder = new ExpressionBuilder(setAttribute.getAssignmentExpression(), matchingMetaInfoHolder, variableExpressionExecutors, tableMap, null, inMemoryAssignmentExecutor, siddhiQueryContext);
        CompiledExpression compiledExpression = compileSetAttribute(expressionBuilder);
        recordTableCompiledUpdateSet.put(setAttribute.getTableVariable().getAttributeName(), compiledExpression);
        Map<String, ExpressionExecutor> expressionExecutorMap = expressionBuilder.getVariableExpressionExecutorMap();
        parentExecutorMap.putAll(expressionExecutorMap);
    }
    recordTableCompiledUpdateSet.setExpressionExecutorMap(parentExecutorMap);
    return recordTableCompiledUpdateSet;
}
Also used : VariableExpressionExecutor(io.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(io.siddhi.core.executor.ExpressionExecutor) HashMap(java.util.HashMap) CompiledUpdateSet(io.siddhi.core.table.CompiledUpdateSet) UpdateSet(io.siddhi.query.api.execution.query.output.stream.UpdateSet) CompiledExpression(io.siddhi.core.util.collection.operator.CompiledExpression)

Aggregations

ExpressionExecutor (io.siddhi.core.executor.ExpressionExecutor)1 VariableExpressionExecutor (io.siddhi.core.executor.VariableExpressionExecutor)1 CompiledUpdateSet (io.siddhi.core.table.CompiledUpdateSet)1 CompiledExpression (io.siddhi.core.util.collection.operator.CompiledExpression)1 UpdateSet (io.siddhi.query.api.execution.query.output.stream.UpdateSet)1 HashMap (java.util.HashMap)1