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

Teradata Vantage™ - SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Administration
Programming Reference
Publication ID
B035-1210-171K
Language
English (United States)

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"