READ_NOS Table Operator | SELECT SQL Statement | Teradata Vantage - Example: Using READ_NOS with NOSREAD_KEYS Return Type - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
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
[...]