...
Operation | Description | Syntax | Example | Result Value | Result Type | ||
---|---|---|---|---|---|---|---|
Creates a map from | mkmap (key_1, val_1, ... , key_n, val_n) | mkmap (10, 1001, 20, 1.33) | {10:1001, 20:1.33} | map(int, float) | |||
collectdistinct() (aggr) | Creates a map of distinct values after an aggregation | collectdistinct(aggr_field) |
| {{1, 3, 20, 4}} | map(int, int,int,int) | ||
Checks if a map is empty | isempty (map) | isempty ({1:10, 2:20, 3:30}) | false | bool | |||
Returns the length of a map | length (map) | length ({1:"a", 2:"b", 3:"c"}) | 3 | int | |||
Checks the | has (map, key) | has ({1:"aaa", 2:"bbb", 77:"ccc"}, 77) | true | bool | |||
Checks the | `in` (key, map) | `in` (77, {1:"aaa", 2:"bbb", 77:"ccc"}) | true | bool | |||
Adds some key-value | add (map, key, value) | add ({5:“Peter", 10:“Ann"}, 4, “xxx") | {5=Peter, 10=Ann, 4=xxx} | map(int, str) | |||
Concatenation of two | add (map_1, map_2) | add ({5:"Peter", 10:"Ann"}, {4:"xxx"}) | {5=Peter, 10=Ann, 4=xxx} | map(int, str) | |||
Given a map, returns the | at (map, key) | at ({"Hello":77, 4:4000}, "Hello") | 77 | int | |||
Intersection of two maps : | band (map_1, map_2) | band ({5:"Five", 2:"Two"}, {2:"xxx"}) | {2=Two} | map(int, str) | |||
Restrict a map to a set of | band (map, set) | band ({5:"Five", 2:"Two", 6:"Six"}, {6, 2}) | {2=Two, 6=Six} | map(int, str) | |||
Deletes the key-value pair | sub (map, key) | sub ({5:"Five", 2:"Two", 6:"Six"}, 5) | {2:“Two", 6:“Six"} | map(int, str) | |||
Deletes the key-value pairs | sub (map, set) | sub ({5:"Five", 2:"Two", 6:"Six"}, {2, 5, 10}) | {6=Six} | map(int, str) | |||
Difference of two maps | sub (map_1, map_2) | sub ({5:"Five", 2:"Two", 6:"Six"} {5:“xxx"}) | {2:“Two", 6:“Six"} | map(int, str) | |||
Returns the set of keys of a given map | keys (map) | keys ({"Hello":77, 4:4000}) | {Hello, 4} | set(str) | |||
Returns the array of values of a given map | values (map) | values ({"Hello":77, 4:4000}) | [77, 4000] | array(int) |
...