ZIP_WITH_INDEX

Combines multiple arrays by index into records

Syntax

ZIP_WITH_INDEX(fieldNames, inputs1[, inputs2, ..., inputsN])

Arguments

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 fieldNames, inputs1[], inputs2[], inputs3[],
        ZIP_WITH_INDEX(null::string, inputs1[], inputs2[], inputs3[]) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET fieldNames = null::string,
        inputs1 = array['a', 'b', 'c'],
        inputs2 = array[1, 2],
        inputs3 = array[false, true, false]
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

Last updated