Performs a mapping of incoming attributes to out-coming attributes using map functions. Odysseus also provides a wide range of mapping functions.
Hint: Map is stateless. To used Map in a statebased fashion see: StateMap
Parameter
expressions:
A list of expressions to map multiple incoming attribute values to out-coming attributes. Optional each expression can have a name (in this case use ['expression', 'expressionName']
)threads:
Number of threads used to process the expressions simultaneous. A positive number greater than 1 indicates the fixed number of threads, a value of 0 or 1 disables threading, and a negative number estimates the number of threads based on the number of expressions and the available processors.
Example
PQL
Code Block |
---|
theme | Eclipse |
---|
language | javascript |
---|
title | Map Operator |
---|
linenumbers | true |
---|
|
output = MAP({
expressions = [
['auction_id * 5','AuctionMult5'],
'sqrt(auction_id)'
]
}, input) |
CQL
Code Block |
---|
theme | Eclipse |
---|
language | sql |
---|
title | Map Operator |
---|
linenumbers | true |
---|
|
SELECT auction_id * 5, sqrt(auction_id) FROM input |