ConfigurationThe configuration of this operator is one single expression with no constraints on the output type. The output type does not have to match with the input type. ExamplesA basic case is to compute something using existing values of the element. For example, if
the input elements are of type {income:element.income, taxes_rate:element.taxes_rate, net_income:income*(1-taxes_rate)} Note:
Using the
spread operator, you can write this in a shorter
way:
Using more advanced features from
the expression language, you can configure the In the following example, we use the {manager:manager, employees:List.sort(manager<-[corporate.Employee.manager], (employee)->employee.birth_date)} In this example, we want to create a map for salaries. Use the Operator to Clean ElementsYou can use the An Item in a stream is just a reference inside the Index data structure. When you put an Item attribute inside a Tuple, it is stored in RAM a second time (Index + processing engine). Sub Processing GraphThe sub processing graph option defines a sub graph that will be applied on each input element. It allows you to define more complex operations. Stateful ModeThe stateful MAP iterates over each element sequentially, and keeps previous results to process the next element. The stream order is preserved and impacts the result. Use this operator to compute things like moving average, derivation, etc. The pseudo code for this operator is the following: var element; var var1 = ...// default value var var2 = ...// default value var var3 = ...// default value while((element = getNextValue()) != null && $termination_expression == false) { var1 = ... //update var var2 = ... //update var var3 = ... //update var emit($output_expression); } Note:
As for now, the operator emits an element for every element of the input
stream. If you need less elements, the best practice is to emit NULL and filter NULL values
afterwards.
|