ARRAY_MAX

Returns the maximum value of the given input array.

Syntax

ARRAY_MAX(X)

Arguments

X

Type: array

An array of any comparable value type.

Returns

Type: same as input

The maximum value within X.


Examples

Transformation job example

SQL

CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true	
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
        MAP_COLUMNS_BY_NAME
    SELECT 
        ARRAY_MAX(ARRAY[3, 4, 0, 2, -1]) AS max_example1,
        ARRAY_MAX(ARRAY[true, false]) AS max_example2
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    GROUP BY shippinginfo_address_state
    LIMIT 1;

Query result

Last updated