JSON External Files | CREATE FOREIGN TABLE SQL Statement | Teradata Vantage - JSON External Files - Analytics Database - Teradata Vantage

Teradata Vantage™ - Native Object Store Getting Started Guide - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
tsq1628112323282.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jjn1567647976698
Product Category
Teradata Vantage
Each record in the JSON external data can span multiple lines—that is, Vantage can read data with embedded line breaks. However, each line break must precede or follow one of these characters:
  • Left brace ({)
  • Comma (,)
  • Double quotation mark (")
  • Right brace (})
  • Colon (:)

Line breaks cannot be within the quotation marks that surround the Name or Value of the Name/Value Pair.

External JSON files can contain individual records or a single JSON array that uses a comma (,) as the record delimiter. For single-array JSON files, the record can span across multiple lines. Optionally, the JSON array can be named.

Vantage can read the following JSON documents in external storage:

 {"field1": true,"field2": "somestring","field3": {"field4": 1}}
{
    "field1" : true,
    "field2":
         "somestring",
    "field3":
    {
        "field4":1
    }
}
[{
                "field1": "string1", "field2": "string2"
}, {
                "field1": "string3", "field2": "string4"
}]

The field names are case sensitive. So, a reference to Field1 will not match the "field1".

Spaces inside quotes for the field names are significant. So, if the record contained "field1 ", then a reference to payload.field1 does not match.

Here is an example of a named JSON array:

{ "Fruits":     [        \{ "fruit": "Apple", "size": "Large", "color": "Red" }
,   

       { "fruit": "Banana", "size": "Medium", "color": "Yellow" },

       { "fruit": "Orange", "size": "Medium", "color": "Orange" },

       { "fruit": "Guava", "size": "Small", "color": "Green" },

       { "fruit": "Grapes", "size": "VerySmall", "color": "Black" }  

   ]

}

External JSON files can be compressed in GZIP format. Other forms of file compression are not supported.