Combine Path and Payload Filters for CSV | NOS | Teradata Vantage - 17.05 - Combining Path and Payload Filtering - Advanced SQL Engine - Teradata Database

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

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1214-175K
Language
English (United States)

For the most selective query results, combine path and payload filtering.

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 it does not exist, create the foreign table or ask your database administrator to create the foreign table called riverflow_csv_path: See Filtering on the Payload Column of a Foreign Table.
  3. Combine path and payload filtering to find how many times the gauge height was greater than 9.5 for a specific year, month, and site number:
    SELECT COUNT(*)
    FROM riverflow_csv_path
    WHERE payload..GageHeight > 9.5
    AND $path.$siteno = 09380000
    AND $path.$year = '2018'
    AND $path.$month = '06';

    Path filtering eliminated entire objects from being read and payload filtering selected the records of interest within those objects.

    Your result will be similar to the following:

       Count(*)
    -----------
            185