trino or presto cast '["b", "a", "b", "c"]' into a values array

Viewed 133

is there a good way to cast a json type of array '["b", "a", "b", "c"]' into an array.

e.g. something that looks like this

select array['b', 'a', 'c', 'b'];
1 Answers

I found it in the documentation:

select CAST(JSON '["b", "a", "b", "c"]' AS ARRAY(varchar));
Related