17.10 - 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.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1214-171K
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
    ( ON 
       (SELECT Location, ObjectLength FROM (
           LOCATION='YOUR-OBJECT-STORE-URI/20180627/'
           AUTHORIZATION=MyAuthObj
           RETURNTYPE='NOSREAD_KEYS'
         ) as d1 )
      USING 
        AUTHORIZATION(MyAuthObj)
        MANIFESTFILE('YOUR-OBJECT-STORE-URI/20180627/ManifestFile3/manifest3.json')
        MANIFESTONLY('TRUE')
        OVERWRITE('TRUE')
    ) AS d;

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

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

    Your result will be similar to the following:

    ObjectName                                                              ObjectSize
    ------------------------------------------------------------------------- ----------
    /S3/s3.amazonaws.com/iewritenostest/20180627/ManifestFile3/manifest3.json        996