JSON Functions (Teradata Database) - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.6
Published
November 2018
Language
English (United States)
Last Update
2018-12-07
dita:mapPath
gxn1538171534877.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

The following table lists the available JSON functions, and a description of their purpose.

XML, JSON etc.: JSON Functions
Function Description
ARRAY_TO_JSON The ARRAY_TO_JSON function converts a Teradata ARRAY type to a JSON type composed of an ARRAY.
GeoJSONFromGeom The GeoJSONFromGeom function converts an ST_Geometry object into a JSON document that conforms to the GeoJSON standards.
Tip: When the “Create Table” option is used with this function, the RETURNS JSON or RETURNS JSON(size) option must also be used.
GeomFromGeoJSON The GeomFromGeoJSON function converts a JSON document that conforms to the GeoJSON standards into an ST_Geometry object.
JSON_AGG The JSON_AGG function returns a JSON document composed of aggregated values from each input parameter. The input parameters can be a column reference or an expression. Each input parameter results in a name/value pair in the returned JSON document.
JSON_COMPOSE JSON_COMPOSE creates a JSON document composed of the input parameters specified. This function provides a complex composition of a JSON document when used in conjunction with the JSON_AGG function.
JSON_CHECK The JSON_CHECK function checks a string for valid JSON syntax and provides an informative error message about the cause of the syntax failure if the string is invalid. It does not create a JSON instance.

This function can be used to validate text before loading JSON data in order to save time in case of syntax errors.

JSON Function calls by default do not include the database name (i.e., TD_SYSFNLIB) as a qualifier for the function name. However, if the option is checked on the Variable Creation analysis parameters tab to Include Embedded Services Database, the JSON function name is qualified by the database name.