Running Examples Without an Authorization Object - Analytics Database - Teradata Vantage

Teradata Vantage™ - Native Object Store Getting Started Guide - 17.20

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
tsq1628112323282.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jjn1567647976698
Product Category
Teradata Vantage

If you want to test examples or test that your credentials work without creating an authorization object, you can use your access id and key in plain text in the command. Include your credentials in the USING clause of the READ_NOS statement in the ACCESS_ID and ACCESS_KEY keywords.

For example:

SELECT TOP 2 location(CHAR(100)), ObjectLength FROM READ_NOS (
USING
LOCATION ('YOUR-OBJECT-STORE-URI')
ACCESS_ID ('YOUR-ACCESS-KEY-ID')
ACCESS_KEY ('YOUR-SECRET-ACCESS-KEY')
RETURNTYPE ('NOSREAD_KEYS')
)
AS d;

Replace YOUR-OBJECT-STORE-URI, YOUR-ACCESS-KEY-ID, and YOUR-SECRET-ACCESS-KEY to access your own external storage and test that your credentials work. For information, see Variable Substitutions for Examples.

For public buckets, ACCESS_ID and ACCESS_KEY are empty strings.

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

By default, the RETURNTYPE is NOSREAD_KEYS, which retrieves a list of files from the path specified by LOCATION. You do not need to specify the RETURNTYPE parameter if you want the default behavior.

Example: Running Examples Without an Authorization Object

The following example shows the READ_NOS statement without an authorization object. It accesses a Teradata-supplied public bucket.

For example:

SELECT TOP 2 * FROM (
LOCATION='/s3/td-usgs-public.s3.amazonaws.com/CSVDATA/'
ACCESS_ID=''
ACCESS_KEY=''
RETURNTYPE='NOSREASD_KEYS'
) AS d;

This example returns one row for each external file. The result lists the object length and location of each file.

For public buckets, ACCESS_ID and ACCESS_KEY are empty strings. If your bucket or container is not public, include the credentials inside the single quotes for each variable.

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