READ_NOS | JSON_KEYS Function | Teradata Vantage - Example: Using READ_NOS to Display Keys in a JSON File without an Extension - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
vjt1596846980081.ditamap
dita:ditavalPath
vjt1596846980081.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantageā„¢

This example uses the READ_NOS table operator with JSON_KEYS function to display the keys in a JSON file.

If not already done, create the authorization object. See Example: Create an Authorization Object.

Perform the READ_NOS:

SELECT DISTINCT * FROM JSON_KEYS (
ON (
SELECT payload FROM (
LOCATION='/s3/td-usgs-public.s3.amazonaws.com/DATA/09380000/2018/06/27'
AUTHORIZATION=MyAuthObj
) AS read_nos_query
) AS json_on_keys_query 
) AS d ;

Result:

JSONKeys        
 --------------- 
 "Flow"         
 "Precipitation"
 "Conductance"  
 "datetime"     
 "site_no"      
 "Temp"         
 "GageHeight"