Hello all, We are trying to <Unnest and join> the...
# troubleshooting
r
Hello all, We are trying to Unnest and join the array which is parsed from a string column (json). But we are not able to cast the varchar into an array by using either CAST or JSON_VALUE with Returning functions. Example:
Copy code
--- "{production_reviews: [{"content": "some_content", "rating": 2},{"content": "some_content", "rating": 4}]}"

select product_reviews from product_table;
Please suggest any way where we can join this array and run aggregate on the rating field.
m
I believe there's currently no way to cast/convert a string into an array, which is why the CROSS JOIN UNNEST doesn't work
r
Thanks Martin In that case, as a workaround will implement an UDTF to cast the string to required format and return set of rows.
πŸ‘ 1