17.10 - Scenario 2: Data Stored as Avro Without Column-Level Schema - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - DATASET Data Type

Advanced SQL Engine
Teradata Database
Release Number
July 2021
English (United States)
Last Update

Use data stored as Avro without a column-level schema to construct an object container file. You have three possibilities for constructing an object container file in this scenario.

The Schemas are the Same, Without a Column-Level Schema

Simply retrieve a schema from an instance, and use this to construct the object container file, following the guidelines of Scenario 1.

The Schemas are Different, But Compatible

Follow the required steps to gather the necessary data and construct the object container file:
  1. Determine the desired schema used to describe all binary-encoded Avro values that compose the object container file.
  2. Use the AvroProject method of the DATASET type to construct Avro instances with the desired schema.
  3. Retrieve only the binary-encoded Avro values from the instances created in step 2 using the getRawData or getRawDataLob methods of the DATASET data type. If the length of these binary-encoded Avro values is also needed,use the getRawDataSize method.

Using the determined upon schema and the projected binary-encoded Avro values, you can construct an object container file using the Avro libraries.

The Schemas are Different, But Not Compatible

Each schema must be isolated, along with any binary-encoded Avro values described by that schema. For each isolated pairing, follow the steps in Scenario 1 to produce an object container file.