FROM_ISO8601_DATE

Parses the ISO 8601 formatted string into a date.

Syntax

FROM_ISO8601_DATE(value)

Arguments

NameTypeDescriptionDefault Value

value

string

Returns

date


Examples

valueOutput

'2006-04-06'

date '2006-04-06'

'2006-4-6'

date '2006-04-06'

'2006-03'

date '2006-03-01'

'2006-3'

date '2006-03-01'

'2006'

date '2006-01-01'

'2006-121'

date '2006-05-01'

'2006-009'

date '2006-01-09'

'2009-W41-7'

date '2009-10-11'

'2009-W41'

date '2009-10-05'

'2009-W1-1'

date '2008-12-29'

'06-12-12'

date '0006-12-12'

'6-12-12'

date '0006-12-12'

'6'

date '0006-01-01'

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 value,
        FROM_ISO8601_DATE(value) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET value = '2006-04-06'
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

valueOutput

'2006-04-06'

date '2006-04-06'

Last updated