17.10 - Using NOSREAD_RECORD to Return the Payload from the Specified LOCATION - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Native Object Store Getting Started Guide

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

NOSREAD_RECORD returns one row for each external record.

The default RETURNTYPE for READ_NOS is NOSREAD_RECORD and as such specifying the RETURNTYPE parameter in the query is optional.

SELECT TOP 2 payload.* FROM (
LOCATION='/s3/td-usgs-public.s3.amazonaws.com/JSONDATA/'
AUTHORIZATION='{"ACCESS_ID":"","ACCESS_KEY":""}'
RETURNTYPE='NOSREAD_RECORD'
) AS d;

The example accesses a Teradata-supplied public bucket containing JSON data. For public buckets, ACCESS_ID and ACCESS_KEY are empty strings. If you are accessing a bucket or container that is not public, include the credentials inside the single quotes for ACCESS_ID and ACCESS_KEY.

Payload is the data stored in the external location specified by LOCATION.

Replace LOCATION, ACCESS_ID, and ACCESS_KEY to access your own external storage.

Result:

Payload.*
---------------------------------------------------------------------------
["09380000","2018-07-02 00:00","11400","8.97","11.4","654","0.00"]
["09380000","2018-06-30 00:00","15900","9.92","10.4","685","0.00"]