Array functions
This page goes over the array functions in Upsolver.
Concatenates all values into a single string, separated by the separator.
ARRAY_JOIN(VALUES, SEPARATOR)
Values | Separator | Result |
"a" , "b" , "c" | ", " | "a, b, c" |
5.5 | ", " | "5.5" |
"a" , "b" , "c" | "" | "abc" |
Return the maximum value in an array.
inputs | result |
1 , 0.2 , 30 | 30 |
Return the minimum value in an array.
inputs | result |
1 , 0.2 , 30 | 0.2 |
Sums all the values in the array.
inputs | result |
1 , 0.2 , 30 | 31.2 |
Returns an error message indicating that CONCAT has been deprecated.
Returns the amount of items in a given array.
input | result |
| 0 |
"a" , "b" , "c" | 3 |
Returns the amount of
true
values in a given array.input | result |
| 0 |
true , false , true | 2 |
Get all the distinct elements in the array.
input | result |
1 , 2 , 3 , 4 , 4 , 1 | 1 , 2 , 3 , 4 |
Gets the element at the given index in the array.
- Index - The index of the item to return
input | Index | result |
"a" , "b" , "c" | 1 | "b" |
"a" | 1 | null |
"a" , "b" , "c" | -1 | null |
Gets the first element in the array.
input | result |
| null |
"a" , "b" , "c" | "a" |
Gets the last element in the array.
input | result |
| null |
"a" , "b" , "c" | "c" |
Return the minimum value.
input | result |
[1, 0.2] , [30] | 0.2 |
This function returns the concatenation of the arguments.
It provides the same functionality as the SQL-standard concatenation operator (||).
PRESTO_CONCAT(STRING1, STRING2, ..., STRINGN)
STRING#
An expression to concatenate. The concatenation of the arguments.
Strings | Result |
"a" , "b" , "c" | "abc" |
"1", "2" , "A", "B" | "12AB" |
Last modified 1yr ago