Database Reference
In-Depth Information
Avro Data Types and Schemas
Avro defines a small number of primitive data types, which can be used to build
application-specific data structures by writing schemas. For interoperability, implementa-
tions must support all Avro types.
Avro's primitive types are listed in Table 12-1 . Each primitive type may also be specified
using a more verbose form by using the type attribute, such as:
{ "type" : "null" }
Table 12-1. Avro primitive types
Type
Description
Schema
The absence of a value
null
"null"
boolean A binary value
"boolean"
32-bit signed integer
int
"int"
64-bit signed integer
long
"long"
float Single-precision (32-bit) IEEE 754 floating-point number "float"
double Double-precision (64-bit) IEEE 754 floating-point number "double"
bytes Sequence of 8-bit unsigned bytes
"bytes"
string Sequence of Unicode characters
"string"
Avro also defines the complex types listed in Table 12-2 , along with a representative ex-
ample of a schema of each type.
Search WWH ::




Custom Search