17.10 - Example: Using READ_NOS to Query a File in Google Cloud Storage - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

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

This SELECT statement uses READ_NOS to query a file in Google Cloud Storage. Instead of using an authorization object, the authorization credentials are including in the AUTHORIZATION keyword.

SELECT payload FROM (
LOCATION='/gs/storage.googleapis.com/td-usgs/JSONDATA/'
AUTHORIZATION='{"ACCESS_ID":"","ACCESS_KEY":""}'
) AS dt;

Depending on the user credentials, Advanced SQL Engine uses either the S3-compatible connector or the native Google connector.

Your result will be similar to the following:

{ "site_no":"09380000", "datetime":"2018-06-27 00:00", "Flow":"16200", "GageHeight":"9.97", "Temp":"11.0", "Conductance":"669", "Precipitation":"0.00"}
{ "site_no":"09380000", "datetime":"2018-06-28 00:00", "Flow":"15900", "GageHeight":"9.91", "Temp":"11.0", "Conductance":"671", "Precipitation":"0.00"}
[...]