These examples use USGS Surface-Water Data Sets from the U.S. Geological Survey.
To run the examples, you can use the river flow data from Teradata-supplied public buckets. Or you can set up a small external object storage for the data set.
The following instructions explain how to set up the river flow data on your own external object storage.
Your external object storage must be configured to allow Analytics Database access.
When you configure external object storage, you set the credentials to your external object storage. Those credentials are used in SQL commands. The supported credentials for USER and PASSWORD (used in the CREATE AUTHORIZATION command) and for ACCESS_ID and ACCESS_KEY (used by READ_NOS and WRITE_NOS) correspond to the values shown in the following table:
System/Scheme | USER/ACCESS_ID | PASSWORD/ACCESS_KEY |
---|---|---|
AWS | Access Key ID | Access Key Secret |
Azure / Shared Key | Storage Account Name | Storage Account Key |
Azure Shared Access Signature (SAS) | Storage Account Name | Account SAS Token |
Google Cloud (S3 interop mode) | Access Key ID | Access Key Secret |
Google Cloud (native) | Client Email | Private Key |
On-premises object storage | Access Key ID | Access Key Secret |
Public access object storage | empty_string Enclose the empty string in single straight quotation marks: USER '' |
empty_string Enclose the empty string in single straight quotation marks: PASSWORD '' |
- Amazon Identity and Access Management (IAM)
- AWS Assume Role used to allow existing AWS IAM users and service accounts temporary access to AWS resources in other accounts.
- Azure service principal used to assign restricted permissions to applications and services accessing Azure external object storage.
- Azure Key Vault used with a foreign table to access Azure blob storage. Use the Azure Key Vault clause to acquire an Azure Storage Account secret from an Azure Key Vault.
See your cloud vendor documentation for instructions on creating an external object storage account.
- Create external object storage on a Teradata-supported external object storage platform. Give your external object storage a unique name. In the Teradata-supplied examples, the bucket/container is called td-usgs. Because the bucket/container name must be unique, choose a name other than td-usgs.
- On Amazon, generate an access ID and matching secret key for your bucket or generate an Identity and Access Management (IAM) user credential. On Azure, generate Account SAS tokens (not Service SAS tokens) for your td-usgs container. On Google Cloud Storage, generate an access ID and matching secret key for your bucket.
- Download the sample data from https://downloads.teradata.com/ (sign in then look for Native Object Store Download Data) to your client/laptop. The ZIP file contains sample river flow data in CSV, JSON, and Parquet data formats.
- Copy the sample data to your bucket or container, being careful to preserve the data directory structure. For example, use a location similar to the following:
- Amazon S3: /S3/YOUR-BUCKET.s3.amazonaws.com/JSONDATA
- Azure Blob storage and Azure Data Lake Storage Gen2: /az/YOUR-STORAGE-ACCOUNT.blob.core.windows.net/td-usgs/CSVDATA/
- Google Cloud Storage: /gs/storage.googleapis.com/YOUR-BUCKET/CSVDATA/
You can use the Amazon S3 or Azure management Console or a utility like AWS CLI to copy the data to your external object storage. For Google Cloud Storage, you can use the gsutil tool to copy the data to your external object storage. - In the example code replace td-usgs, YOUR-BUCKET, and YOUR-STORAGE-ACCOUNT with the location of your external object storage.
- Replace YOUR-ACCESS-KEY-ID and YOUR-SECRET-ACCESS-KEY with the access values for your external object storage.
The following steps may require the assistance of your public cloud administrator.