This is an example of how to use the READ_NOS table operator with a return type of NOSREAD_KEYS to list external files at a specified location.
This statement performs a query of a JSON file. The files specified by the LOCATION option include the extensions, .json and .json.gz. If the files have extension other than .json, .json.gz, .csv, or .tsv, you must specify an ON clause where the payload of the input table must match the payload returned by READ_NOS.
If not already done, create the authorization object. See Example: Create an Authorization Object.
Perform the READ_NOS:
SELECT location FROM ( LOCATION='/s3/td-usgs-public.s3.amazonaws.com/JSONDATA' AUTHORIZATION=MyAuthObj RETURNTYPE='NOSREAD_KEYS' ) AS d;
Your result will be similar to the following:
Location -------------------------------------------------------------- /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/27.json /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/28.json /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/29.json /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/30.json /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/07/01.json [...]