Sample External JSON Data with READ_NOS | Native Object Store | Teradata Vantage - 17.10 - Sampling External Data in Place Using READ_NOS - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Native Object Store Getting Started Guide

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

Preview the contents of an external object store by using the READ_NOS table operator. In this example, READ_NOS is defined in a function mapping called READ_NOS_FM.

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. Sample the data in place:
    SELECT TOP 2 * FROM READ_NOS_FM (
    USING
    LOCATION('YOUR-OBJECT-STORE-URI')
    RETURNTYPE('NOSREAD_RECORD')

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

    Your result will be similar to the following:

            Location /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/29.json
     ObjectVersionId ?
     ObjectTimeStamp                          ?
    OffsetIntoObject                    0
        ObjectLength         151
          ExtraField ?
             Payload { "site_no":"09380000", "datetime":"2018-06-29 00:00", "Flow":"15700", "GageHeight":"9.87", "Temp":"10.6", "Conductance":"684", "Precipitation":"0.00"}
    
            Location /S3/s3.amazonaws.com/td-usgs-public/JSONDATA/09380000/2018/06/28.json
     ObjectVersionId ?
     ObjectTimeStamp                          ?
    OffsetIntoObject                    0
        ObjectLength         151
          ExtraField ?
             Payload { "site_no":"09380000", "datetime":"2018-06-28 00:00", "Flow":"15900", "GageHeight":"9.91", "Temp":"11.0", "Conductance":"671", "Precipitation":"0.00"}
    

    The output is displayed vertically for readability.