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;
    }
Try updating the records if they exist else add the records

@param updateCondition              the compiledCondition against which records should be matched for update
@param updateConditionParameterMaps map of matching StreamVariable Ids and their values corresponding to the
                                    compiled condition based on which the records will be updated
@param updateSetExpressions         the set of updates mappings and related complied expressions
@param updateSetParameterMaps       map of matching StreamVariable Ids and their values corresponding to the
                                    update set
@param addingRecords                the values for adding new records if the update condition did not match
@throws ConnectionUnavailableException
modules/siddhi-core/src/main/java/io/siddhi/core/table/record/AbstractRecordTable.java