Data not stored as Avro, whether stored in a Teradata table, a constant value, the result of some other operation, may be published to the Avro format and used to construct an object container file. Follow these steps to gather the data and construct the object container file:
- Formulate a query to publish data in the desired Avro format using the DATASET_PUBLISH table operator.
- Obtain the schema for the object container file by executing the getSchema method of the DATASET type on the data output column of DATASET_PUBLISH. This provides an Avro instance that contains the schema and binary-encoded Avro value created.