17.05 - Example: Create a Manifest File 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.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1214-175K
Language
English (United States)

If a WRITE_NOS operation fails before it can create a manifest file you can use READ_NOS with RETURNTYPE('NOSREAD_KEYS') to read the keys of the existing objects in the external storage. This is used as input to create a new manifest file. The new manifest file created this way reflects all data objects currently in the external storage location, and can aid in determining which data objects resulted from an incomplete WRITE_NOS operation.

  1. Create a manifest file using READ_NOS as input:
    SELECT * FROM WRITE_NOS_FM 
    ( ON 
       (SELECT Location, ObjectLength
        FROM READ_NOS_FM1 
        (ON (SELECT CAST(NULL AS JSON CHARACTER SET UNICODE))
         USING
           LOCATION('YOUR-STORAGE-ACCOUNT/20180701/')
           RETURNTYPE('NOSREAD_KEYS')
         ) as d1 )
      USING 
        MANIFESTFILE('YOUR-STORAGE-ACCOUNT/20180701/ManifestFile3/manifest3.json')
        MANIFESTONLY('TRUE')
        OVERWRITE('TRUE')
    ) AS d;
    

    Replace the LOCATION of YOUR-STORAGE-ACCOUNT/20180701/ with the URI to the external object store location where you want to write the manifest file.

    Replace the MANIFESTFILE location of YOUR-STORAGE-ACCOUNT/20180701/ManifestFile3/manifest3.json with the URI to the manifest file on external object store.