JSONMETADATA Function | Teradata Vantage - JSONMETADATA - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
gzn1554761068186.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantage™

An aggregate function that returns metadata about a set of JSON documents.

This method returns a JSON object with the following format:

{
    "doc_count":
    “size”: 
    {
		       “min”:
		       “max”:
		       “avg”:
    }
    “depth”:
    {
		        “min”:
		        “max”:
		        “avg”:
    } 
    “keycnt”:
    {
		        “min”:
		        “max”:
		        “avg”:
    }
    “objcnt”:
    {
		        “min”:
		        “max”:
		        “avg”:
    }
    “arycnt”:
    {
		        “min”:
		        “max”:
		        “avg”:
    }
    “strcnt”:
    {
		        “min”:
		        “max”:
		        “avg”:
    }
    “nbrcnt”:
    {
		         “min”:
		         “max”:
		         “avg”:
    }
    “boolcnt”:
    {
		         “min”:
		         “max”:
		         “avg”:
    }
    “nullcnt”:
    {
		         “min”:
		         “max”:
		         “avg”:
    }
   "keylen":
   {
        "min":
        "max":
        "avg":
   }
   "strvallen":
   {
        "min":
        "max":
        "avg":
   }
}

For each field, a minimum, maximum, and average is calculated across the entire input set of JSON documents. doc_count is the total number of rows which were counted by the aggregation.