Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 452

What's the right way to cast ARRAY to JSON in Trino

$
0
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?


Viewing all articles
Browse latest Browse all 452

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>