Sample External Data with a Foreign Table | NOS | VantageCloud Lake - Sampling External Data in Place Using a Foreign Table - Teradata VantageCloud Lake

Lake - Manage and Move Data

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-05-16
dita:mapPath
atx1683670417382.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
atx1683670417382

Preview random rows of data in place from external object storage using a foreign table.

The examples use a sample river flow data set. To use your own data, replace the table and column names, and authorization object. See Variable Substitutions for Examples for the credentials and location values for the sample data set.

  1. To run NOS-related commands, log on to the database as a user with the required privileges.
  2. If the foreign table does not exist, create it or ask your database administrator to create it. See Setting Up to Run Examples.
  3. To see sample records with the attribute names included before each string of values, issue the following command against the foreign table:
    SELECT TOP 2 *
    FROM table_name;
    If you run this on JSON data, the results look different because you get a payload. Inside the payload field, you get a comma delimited list of values.

    On CSV and Parquet, you get a list of columns with data.

Example: Sampling External Data in Place Using a Foreign Table

If not already done, create the foreign table. See Setting Up to Run Examples.

SELECT TOP 2 *
FROM riverflow;

Results a similar to the following:

    Location /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09400815/2018/07/10.csv
  GageHeight2     ?
         Flow   .00
      site_no     9400815
     datetime 2018-07-10 00:00
Precipitation   .00
   GageHeight  -.01

     Location /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09400815/2018/07/12.csv
  GageHeight2     ?
         Flow   .00
      site_no     9400815
     datetime 2018-07-12 00:00
Precipitation   .00
   GageHeight  -.01

The output is displayed vertically for readability.