Basic Foreign Table View | Native Object Store ( NOS ) | Teradata Vantage - Creating a Basic View - 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-04-05
dita:mapPath
tsq1628112323282.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jjn1567647976698
Product Category
Teradata Vantage
Creating a view allows you to:
  • CAST the payload fields to an appropriate data type.
  • Rename the header fields using case insensitive naming. Although the example shows the headers in mixed case, you can use whatever case you want in queries.

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 that the new view will represent does not exist, create it or ask your database administrator to create it. See Filtering Using a Path Filter in the CREATE FOREIGN TABLE Definition.
  3. Create the view on the foreign table:
    CREATE VIEW view_name AS (
    SELECT
    columnX,
    columnY,
    columnZ,
    columnN
    FROM table_name );

Example: Creating a Basic View

Create the view of the foreign table.

If not already done, create the foreign table that the new view will represent. See Filtering Using a Path Filter in the CREATE FOREIGN TABLE Definition.

CREATE VIEW riverflowview AS (
SELECT
Flow,
GageHeight,
Precipitation,
Site_no
FROM riverflow_pathfilter );

Query the view:

SELECT TOP 2 * FROM riverflowview;

Your result will be similar to the following:

Flow    GageHeight Precipitation  site_no 
------  ---------- -------------  -------------- 
17500   10.21      .00            09396100       
17700   10.25      .00            09396100

Columns with missing attributes return NULLs when the record does not contain the attribute.