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

SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2023-04-27
dita:mapPath
fsi1592016213432.ditamap
dita:ditavalPath
fsi1592016213432.ditaval
dita:id
B035-1210
lifecycle
previous
Product Category
Teradata Vantage™

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"}
[...]