FROM_KEY_VALUE

Maps a list of key values to a record with fields for each key.

Syntax

FROM_KEY_VALUE(keys, key, value)

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 keys, key[], value[],
        FROM_KEY_VALUE('foo, hello', key[], value[]) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET keys = 'foo, hello',
        key = array['foo', 'hello'],
        value = array['bar', 'world']
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

Last updated