Reputation: 359
I have a table that has a column that contains an array of strings, example
["Emily", "Anna"]
, I need to parse this array into 2 columns.
Is there a way to do this in sql?
I have tried OPENJSON but this function doesn't work in databricks
Upvotes: 1
Views: 253
Reputation: 23726
Just use the array element indexes:
SELECT
mycolumn[1] AS first_value,
mycolumn[2] AS second_value
FROM
mytable
Upvotes: 2