CSV File | READ_NOS Query | Teradata Vantage - Example: Using READ_NOS to Query an External CSV File - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
vjt1596846980081.ditamap
dita:ditavalPath
vjt1596846980081.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantageā„¢

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