Avro Support(4.3)
This page describes the Avro support for Ultra Format Definition Language (UFDL). This functionality enables you to compile Avro definitions, and to encode data into, and from the Avro format. A schema in Avro is represented in JSON. You can implement non-protocol data issues in an Analysis agent.
Note!
It is also possible to encode/decode Avro messages using schema retrieved from an external schema registry. See Decoder/Encoder(4.3)Â for more information.
Overview
Avro parsing in UFDL is managed by applying the avro_block
 construct.
avro_block {
<avro json schema>
};
The output from an Avro encoder represents a single Avro record, not a complete Avro data file. To de-serialize these records using a third party tool, add the correct Avro header to the records based on the description of Avro provided in the link below.
The full description of the Avro language can be found at:Â https://avro.apache.org/docs/current/spec.html.
The Avro Types
The Avro JSON schema can be defined with any of the following types:
Note!
There are limitations to the implementation of the following elements. See the section Limitations below for further information.
Primitive Type | Notes |
---|---|
| Implemented as type |
| Value must be |
| 32-bit signed |
| 64-bit signed |
| Single precision (32-bit) IEEE 754 floating-point number |
| Double precision (64-bit) IEEE 754 floating-point number |
| Sequence of 8-bit unsigned bytes |
| Unicode character sequence |
Complex Type | Notes |
---|---|
| Supports the attributes:Â The |
| Supports the attributes:Â |
| Supports the attribute:Â |
| Supports the attribute:Â |
| Implemented as a record with all types set to optional. If two values are set, both are encoded. If no values are set, none are encoded. To specify a union value, you must use |
| Supports the attributes:Â |
Note!
Use the doc
 attribute to add a comment.
Limitations
The following limitations apply for the Avro support in Usage Engine:
Line and Column are not fully implemented.
No string values are permitted in APL for the
enum
 type.Encoding the Avro object container file is not supported.
aliases
are not fully supported.default
 is not fully supported.Cross-references to other Ultra definitions are not supported.
array of arrays
is not correctly implemented. For example,array of array of x
 is implemented withÂarray of y
, whereÂy
 is a record with oneÂvalue
 field. ThisÂvalue
 field is anÂarray of x
.map of x
 is implemented via anÂarray of y
, whereÂy
 is a record with two fields:Âkey
 andÂvalue
, whereÂvalue
 isÂx
.
Avro Format Example
To encode an Arvo data file, a format definition is included in the Ultra avro_block
 block in the Ultra format.