Load External Data | Native Object Store ( NOS ) | Teradata Vantage - Loading External Data into the Database Using CREATE TABLE AS … WITH DATA - Analytics Database - Teradata Vantage

Teradata Vantage™ - Native Object Store Getting Started Guide - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
tsq1628112323282.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jjn1567647976698
lifecycle
latest
Product Category
Teradata Vantage

If you access the same external data often, copy the data inside the database. To do this, copy the table definitions and data from the existing foreign table to a new target table inside the database using a CREATE TABLE AS … WITH DATA command.

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. Create a table in the database to load a subset of the external data that you are interested in analyzing:
    CREATE MULTISET TABLE multiset_table_name AS (
    SELECT columnX, columnY, columnN
    FROM table_name
    WHERE columnN > value )
    WITH DATA
    NO PRIMARY INDEX;

Example: Loading External Data into the Database Using CREATE TABLE AS … WITH DATA

If not already done, create the foreign table that points to external data to be loaded. See Setting Up to Run Examples.

Create a table in the database to load a subset of external data to analyze.

CREATE MULTISET TABLE riverflowprecip AS (
SELECT site_no, Flow, GageHeight
FROM riverflow
WHERE Precipitation > 0 )
WITH DATA
NO PRIMARY INDEX;

Show the number of rows in the table:

SELECT COUNT(*) FROM riverflowprecip;

Your result will be similar to the following:

Count(*)
-----------
        291