Set Up to Run CSV Examples | Native Object Store ( NOS ) | Teradata Vantage - Setting Up to Run CSV Examples - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Native Object Store Getting Started Guide

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
jjn1567647976698.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1214
lifecycle
previous
Product Category
Software
Teradata Vantage

To use NOS, create a foreign table definition inside Advanced SQL Engine, point it at any external object store you are authorized to access, and then you can explore the data using all the analytics ability of Teradata Vantage. The NOS table definition is called a foreign table. A foreign table makes the external data available in a structured relational format, allowing it to be aggregated or joined to other relational tables inside the database.

Data read through a foreign server is not automatically stored on disk and the data can only be seen by that query. Data can be loaded into the database using the techniques shown in Loading External CSV Data into the Database.

The examples and results show a sample river flow data set. To use your own data, replace the table and column names, and authorization object.

  1. To run NOS-related commands, log on to the database as a user with the required privileges.
  2. Create the foreign table or ask your database administrator to create the foreign table that is used by the Teradata-supplied examples:
    CREATE FOREIGN TABLE riverflow_csv
    , EXTERNAL SECURITY DEFINER TRUSTED DefAuth
    (  Location VARCHAR(2048) CHARACTER SET UNICODE CASESPECIFIC,
       Payload DATASET INLINE LENGTH 64000 STORAGE FORMAT CSV
    )
    USING (LOCATION('YOUR-STORAGE-ACCOUNT'));

    See Variable Substitutions for Examples for the credentials and location values for the sample river flow data set.

    Each record contains a CSV record in the payload column.

  3. Query the table:
    SELECT TOP 2 payload
    FROM riverflow_csv;

    Your result will be similar to the following:

    Payload
    ---------------------------------------------------------------------------------
    BatteryVoltage,Flow,site_no,datetime,Precipitation,GageHeight ,0.00,09400815,2018-07-12 00:15,0.00,-0.01
    BatteryVoltage,Flow,site_no,datetime,Precipitation,GageHeight ,0.00,09400815,2018-07-12 00:45,0.00,-0.01