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:
- Determine the desired schema used to describe all binary-encoded Avro values that compose the object container file.
- Use the AvroProject method of the DATASET type to construct Avro instances with the desired schema.
- 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.