Data Types in Avro
Posted August 17, 2022 by Rohith ‐ 1 min read
Avro is used in many data processing frameworks like kafka, spark, etc. It is important to know the data types supported in avro data format.
On this page
The following table lists the Avro data types
Avro Data Types
Avro Data Type | Common equivalent type | Range |
---|---|---|
Array | Array | Unlimited number of characters. |
Boolean | Integer | TRUE (1) or FALSE (0). |
Bytes | Binary | Precision 4000. |
Date | Date/Time | January 1, 0001 to December 31, 9999. |
Decimal | Decimal | support precision up to 38 digits, the precision is 1 to 38 digits, and the supported scale is 0 to 38. |
Double | Double | Precision 15. |
Fixed | Binary | up to 100MiB |
Float | Double | Precision up to 15. |
Int | Integer | -2,147,483,648 to 2,147,483,647 Precision 10 and scale 0. |
Long | Bigint | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Precision 19 and scale 0. |
Map | Map | Unlimited number of characters. |
Record | Struct | Unlimited number of characters. |
String | String | 1 to 104,857,600 characters. |
Time | Date/Time | Time of the day. Precision to microsecond. |
Timestamp | Date/Time | January 1, 0001 00:00:00 to December 31, 9999 23:59:59.997. Precision to microsecond. |
Union | ["primitive_type|complex_type", "null"] or ["null", "primitive_type|complex_type"] . | Dependent on primitive or complex data type. |