JSONParser Example 3: Parse with Ancestor - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™

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