Running Examples without an Authorization Object - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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 object 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 external object storage.

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. The statement 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 external object storage.