READ_NOS Table Operator | SELECT SQL Statement | Teradata Vantage - Example: Using READ_NOS with NOSREAD_KEYS Return Type - 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 is an example of how to use the READ_NOS table operator with a return type of NOSREAD_KEYS to list external files at a specified location.

This statement performs a query of a JSON file. The files specified by the LOCATION option include the extensions, .json and .json.gz. If the files have extension other than .json, .json.gz, .csv, or .tsv, you must specify an ON clause where the payload of the input table must match the payload returned by READ_NOS.

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

Perform the READ_NOS:

SELECT location FROM (
LOCATION='/s3/td-usgs-public.s3.amazonaws.com/JSONDATA'
AUTHORIZATION=MyAuthObj
RETURNTYPE='NOSREAD_KEYS'
) AS d;

Your result will be similar to the following:

 Location                                                       
 -------------------------------------------------------------- 
/S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/27.json
/S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/28.json
/S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/29.json
/S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/30.json
/S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/07/01.json
[...]