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

DATASET Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
amv1590702100517.ditamap
dita:ditavalPath
amv1590702100517.ditaval
dita:id
B035-1198
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.