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