TRY_TO_DATE converts input to a date when possible and returns NULL instead of an error when the value does not match the date type. This protects ingestion pipelines from invalid source dates. section 4.2
Protecting a JSON ingestion query
Replace a strict cast such as customer_orders:"Order date"::date with TRY_TO_DATE(customer_orders:"Order date") when source values may contain invalid dates. Valid values become dates; invalid values become NULL, allowing ingestion to continue. section 4.2
Listing 4.2 Selecting values from keys at the highest level of the hierarchy
select customer_orders:"Customer"::varchar as customer, customer_orders:"Order date"::date as order_date, customer_orders:"Orders" from ORDERS_PARK_INN_RAW_STG;
Compare the strict ::date conversion used for the highest-level Order date field with the error-handling alternative. section 4.2
