...
Unordered: Elements do not follow a specific order.
Unique: No duplicates are allowed.
Related operations:
Operation | Description | Syntax | Example | Result Value | Result Type |
---|---|---|---|---|---|
mkset or {} | creates a set from elements | mkset (ele_1, ... , | mkset (1.33,2,3,4) | {1.33, 2, 3, 4} | set(float) |
isempty | Checks if a set is empty | isempty (set) | isempty ({1, 2, 3}) | false | bool |
length | Returns the length of a set | length (set) | length ({1, 20, 3, 4, 20, 20}) | 4 | int |
size | Returns the length of a set | size (set) | size ({1, 20, 3, 4, 20, 20}) | 4 | int |
has (->) | Checks the occurrence of | has (set, ele) | has ({31, 2, 77}, 77) | true | bool |
in (<-) | Checks the occurrence of | `in` (ele, set) | `in` (77, {30, 2, 77}) | true | bool |
has (->) | Checks whether a set | has (set_1, set_2) | has ({1, 2 , 3, 4}, {2, 1}) | true | bool |
in (<-) | Checks whether a set | `in` (set_1, set_2) | `in` ({1, 2 , 3, 4}, {2, 1}) | false | bool |
add (+) | Adds some value to a set | add (set, ele) | add ({30, "Peter", 77}, “Ann") | {30, Peter, 77, Ann} | set(str) |
add (+) | Union of two sets | add (set_1, set_2) | add ({5, "Peter", 77}, {77, "Ann", 400}) | {5, Peter, 77, Ann, 400] | set(str) |
join * | Joins the strings of a given | join (set_str) | join ({1, "Peter", 77, 77, "Ann"}) | 1Ann77Peter | str |
band | Intersection of two sets | band (set_1, set_2) | band ({30, 2, 77}, {77, 400}) | {77} | set(int) |
sub (-) | Deletes a value from a set | sub (set, ele) | sub ({30, 2, 77}, 400) | {30, 2, 77} | •set(int) |
sub (-) | Difference of two sets | sub (set_1, set_2) | sub ({30, 2, 77}, {400, 30}) | {2, 77} | set(int) |
...
Key-Value Structure: Each pair associates a key with a value.
Unique Keys: Each key must be unique, though values can repeat.
Related operations:
Operation | Description | Syntax | Example | Result Value | Result Type |
---|---|---|---|---|---|
mkmap or { : } | 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) |
isempty | Checks if a map is empty | isempty (map) | isempty ({1:10, 2:20, 3:30}) | false | bool |
length | Returns the length of a map | length (map) | length ({1:"a", 2:"b", 3:"c"}) | 3 | int |
size | Returns the length of a map | size (map) | size ({1:"a", 2:"b", 3:"c"}) | 3 | int |
has (->) | Checks the | has (map, key) | has ({1:"aaa", 2:"bbb", 77:"ccc"}, 77) | true | bool |
in (<-) | Checks the | `in` (key, map) | `in` (77, {1:"aaa", 2:"bbb", 77:"ccc"}) | true | bool |
add (+) | Adds some key-value | add (map, key, value) | add ({5:“Peter", 10:“Ann"}, 4, “xxx") | {5=Peter, 10=Ann, 4=xxx} | map(int, str) |
add (+) | Concatenation of two | add (map_1, map_2) | add ({5:"Peter", 10:"Ann"}, {4:"xxx"}) | {5=Peter, 10=Ann, 4=xxx} | map(int, str) |
at [ ] | Given a map, returns the | at (map, key) | at ({"Hello":77, 4:4000}, "Hello") | 77 | int |
band | Intersection of two maps : | band (map_1, map_2) | band ({5:"Five", 2:"Two"}, {2:"xxx"}) | {2=Two} | map(int, str) |
band | 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) |
sub (-) | Deletes the key-value pair | sub (map, key) | sub ({5:"Five", 2:"Two", 6:"Six"}, 5) | {2:“Two", 6:“Six"} | map(int, str) |
sub (-) | Deletes the key-value pairs | sub (map, set) | sub ({5:"Five", 2:"Two", 6:"Six"}, {2, 5, 10}) | {6=Six} | map(int, str) |
sub (-) | 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) |
keys | Returns the set of keys of a given map | keys (map) | keys ({"Hello":77, 4:4000}) | {Hello, 4} | set(str) |
values | Returns the array of values of a given map | values (map) | values ({"Hello":77, 4:4000}) | [77, 4000] | array(int) |
...
Ordered: Elements follow a specific sequence.
Allows Duplicates: Identical elements can appear multiple times.
Related operations:
Operation | Description | Syntax | Example | Result Value | Result Type |
---|---|---|---|---|---|
mkarray or [] | Creates an array from elements | mkarray (ele_1, … ,ele_n) | mkarray (1.33,2,3,4) mkarray (“One", "two", "Number 3“) [ “One", 77 ] mkarray (domain, responseTime) | [1.33, 2, 3, 4] | array(float) array(str) array(str) array(str) |
isempty | Checks if an array is empty | isempty (array) | isempty ([1, 2, 3]) isempty ([ ]) | false true | bool |
length | Returns the length of an array | length (array) | length ([1, 2, 3, 4, 5, 6]) | 6 | Int |
size | Returns the length of an array | size (array) | size ([1, 2, 3, 4, 5, 6]) | 6 | Int |
has (->) | Checks the occurrence of a specified value in a given array | •has (array, ele) •array -> ele | has ([30, 2, 77], 77) [30, 2, 77] -> 77 | true true | bool |
in (<-) | Checks the occurrence of a specified value in a given array | `in` (ele, array) ele <- array | `in` (77, [30, 2, 77]) 77 <- [30, 2, 77] | true true | bool |
add (+) | Appends some value to the end of an array | add (array, ele) | add ([30, "Peter", 77], "Ann") | [30, Peter, 77, Ann] | array(str) |
add (+) | Concatenates two arrays | add (array_1, array_2) | add ([5, "Peter", 77], [77, "Ann", 400]) | [5, Peter, 77, 77, Ann, 400] | array(str) |
join | Joins the strings of a given | join (array_str) | join ([1, "Peter", 77, 77, "Ann"]) | 1Peter7777Ann | str |
at or [][] | Returns the n-th element of | at (array, n) | at ([10, 20, 3.33, 40], 1) | 20 | float |
at or [][] | Returns a subarray between | at (array, from, to) | at ([10, 20, 30, 40], 1, 3) | [20, 30] | array(int) |
indexof | Returns the index of the first | indexof (array, ele) | indexof ([10, 20, 3.33, 40], 3.33) | 2 | int |
dropnulls | Drops null elements of a given array | dropnulls (array) | dropnulls ([3, null, 77, null]) | [3, 77] | array(int) |
sort | Sorts the elements of a | sort (array) | sort ([3, 77, 30, 1) | [1, 3, 30, 77] | array(int) |
reverse | Reverses the elements of | reverse | reverse ([3, 77, 30, 1) | [1, 30, 77, 3] | array(int) |
sum | Sums the values of a | sum (array) | sum([1,2,3,4]) | 10 | Int |
...
Ordered: Elements are stored in a specific sequence.
Immutable: The values in a tuple cannot be modified after creation.
Allows Duplicates: Identical elements can appear more than once.
Allows Mixed Types: Elements can be of any type (e.g., string, integer, boolean).
Related operations:
Operation | Description | Syntax | Example | Result Value | Result Type |
---|---|---|---|---|---|
mktuple | Creates a tuple with specified elements. |
|
|
|
|
Tuple literal | Creates a tuple using parentheses. |
|
|
|
|
Access by index | Access tuple elements using index. Supports negative indexing. |
|
| First element Last element | Matches element type |
| Access tuple elements by index using a function. |
|
| First element | Matches element type |
Filter by type | Filters tuple elements based on data type or pattern. |
|
| Matches filtered criteria |
|
Filter by value | Filters tuple elements based on value comparison. |
|
| Matches filtered criteria |
|
Sub-query (key lookup) | Finds the occurrence of a key in another dataset during the same period. |
|
| Matched key occurrence | Matches key type |
Sub-query (field lookup) | Returns a field from another table matching a condition. |
|
|
| Matches field type |
Sub-query (tuple matching) | Returns a tuple from another table matching specified conditions. |
|
|
|
|
...