The JSON_PUBLISH table operator combines the functionality of JSON_AGG and JSON_COMPOSE and is used to publish Vantage data values into a JSON document. It has the following advantages over JSON_AGG and JSON_COMPOSE:
- It has the ability to aggregate data over 64K into a JSON document.
- It provides consistent behavior in terms of output structure.
By default the JSON document is composed of a top-level JSON array which contains one or more elements representing each group of data published, even if only one output group of data is included. This can be modified if desired, but the default behavior is consistent.
- It provides the ability to publish data into any supported JSON format, even the binary storage formats.
This is very useful if loading data into a table which uses one of these storage formats, or exporting the data to an external system which recognizes these formats.