1.0 - 8.00 - JSONParser Example 3: Parse with Ancestor - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

Input

The input table is json_parser_data_2, as in JSONParser Example 2: Default Values.

SQL Call

SELECT * FROM JSONParser (
  ON json_parser_data_2
  USING
  TextColumn ('data1')
  Nodes ('GlossEntry/ID', 'GlossEntry/SortAs', 'GlossEntry/GlossTerm',
         'GlossEntry/Acronym', '/email')
  SearchPath ('/glossary/GlossDiv/GlossList')
  Delimiter (' | ')
  Accumulate ('id')
  MaxItemNum (10)
) AS dt ORDER BY 1, 2;

Output

Because the email field is not included in the specified search path, the email column is empty.

id out_nodeid out_parent_node GlossEntry:ID GlossEntry:SortAs GlossEntry:GlossTerm GlossEntry:Acronym :email
1 1 GlossEntry SGML   Standard Generalized Markup Language    
1 2 GlossEntry   SGML   SGML  
1 3 GlossEntry          
1 4 GlossEntry