CSV File | READ_NOS Query | Teradata Vantage - 17.10 - Example: Using READ_NOS to Query an External CSV File - 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 example uses the READ_NOS table operator to query an external CSV file. This query uses READ_NOS to select specific columns. The LOCATION parameter specifies a CSV file stored on Amazon S3.

If not already done, create the authorization object. See Example: Create an Authorization Object.

Run the READ_NOS:

SELECT Flow, Precipitation, datetime, site_no, GageHeight
FROM (
LOCATION='/S3/td-usgs-public.s3.amazonaws.com/CSVDATA/'
AUTHORIZATION=MyAuthObj
) AS derived_table
WHERE GageHeight > 3.64
ORDER BY datetime;

Results:

Flow  Precipitation          datetime      site_no  GageHeight
-----  -------------  ----------------  -----------  ----------
  .00            .00  2018-06-27 00:00      9400568        6.51
  .01            .00  2018-06-27 00:00      9394500        4.75
  .00            .00  2018-06-27 00:15      9400568        6.51
  .01            .00  2018-06-27 00:15      9394500        4.75
  .00            .00  2018-06-27 00:30      9400568        6.51
[...]