17.10 - Using NOSREAD_KEYS to List the Files in 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_KEYS retrieves a list of files from the path specified by LOCATION.

SELECT TOP 2 location(CHAR(200)), ObjectLength FROM (
LOCATION='/s3/td-usgs-public.s3.amazonaws.com/CSVDATA/'
AUTHORIZATION='{"ACCESS_ID":"","ACCESS_KEY":""}'
RETURNTYPE='NOSREAD_KEYS'
) AS d;

The example accesses the Teradata-supplied public bucket. 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 quotes for ACCESS_ID and ACCESS_KEY.

ObjectLength is the size of the external files in the specified LOCATION of the object store.

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

Your result will be similar to the following:

Location  /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09380000/2018/06/30.csv
ObjectLength  5009

Location  /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09380000/2018/06/29.csv
ObjectLength  5088