you are using wrong syntax for try_cast. according to snowflake documentations the syntax is :
TRY_CAST( <source_string_expr> AS <target_data_type> )
and also note:
- Only works for string expressions.
- target_data_type must be one of the following:
- VARCHAR (or any of its synonyms)
- NUMBER (or any of its synonyms)
- DOUBLE
- BOOLEAN
- DATE
- TIME
- TIMESTAMP, TIMESTAMP_LTZ, TIMESTAMP_NTZ, or TIMESTAMP_TZ
so for example you have to have something like this if item.value:price
is string:
select try_cast(item.value:price as NUMBER) as item_price,
....
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…