0

I tried

select 
  json_format(cast(COALESCE(array_of_row, array[]) as JSON))
from my table

and it appears to work, but the trino documentation says that both JSON type and json_format are considered deprecated:

The following functions and operators are not compliant with the SQL standard, and should be considered deprecated. According to the SQL standard, there shall be no JSON data type. Instead, JSON values should be represented as string values. The remaining functionality of the following functions is covered by the functions described previously.

on https://trino.io/docs/current/functions/json.html#cast-to-json, so what's the proper alternative way to do the same?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.