TO_ARRAY

Outputs all the values from all the inputs as an array

Syntax

TO_ARRAY(inputs1[, inputs2, ..., inputsN])

Arguments

NameTypeDescriptionDefault Value

inputs#

any

Returns

Returns the same as the input.

Examples

inputs1inputs2Output

array['a', 'c']

'b'

[a, c, b]

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 inputs1[], inputs2,
        TO_ARRAY(inputs1[], inputs2) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET inputs1 = array['a', 'c'],
        inputs2 = 'b'
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

inputs1[]inputs2Output

array['a', 'c']

'b'

[a, c, b]

Last updated