EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Software Development Software Development Tutorials Software Development Basics Avro Data Types
 

Avro Data Types

Updated February 18, 2023

Avro Data Types

 

 

Introduction to Avro Data Types

Avro data types are defined as avro is a serialization format that does not put up the issue even if its value can be changeable or not. It has been planned to modify the data type as it is a data integration service that has been utilized to proceed data over the platform; many typed systems are close to other typed systems, and instead of using a new data type, avro can utilize the avro serialization format, data types utilize the string and JSON objects. It has boolean, integer, floating-point, string primitives, null type, array, records, enumeration sets, byte sequence, fixed-width byte sequence, and tagged union.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

List of Avro Data Types

Given below is the list of Avro Data Types:

1. Null Type

This type has been mentioned as “null” as a string in quotes; it has one realizable value but without quotes. The Portable Format Analytics (PFA) does not convert the type; it does not return any value.

The union of some types means string and null constitute as:

Avro Data Types 1

The above specifies that the string value will be missing as it differs from “string.”

2. Boolean

This data type can be represented as “boolean”; it has true and false values but without quotes.

This type is not a subclass of integer; hence if we want to change a Boolean variable y into zero or one, then the expression will be as:

Boolean

3. Integer Type

There are two integers types one is “int” for 32-bit signed integers, and the second is “long” for “64-bit” signed integers, in which the “int” format is the default for functions, and the exact integer will be in JSON and PFA expressions that translated as “int.”

4. Floating-Point Types

There are two floating points, one is “float” for 32-bit, and the second is “double” for 64-bit as “double” is the default for various functions, and the exact floating-point number will get in JSON format, and the appearance of PFA has been translated as, “double.”

Avro Data Types 3

5. String Type

This data type has been written as “string” it can take any reasonable Unicode sequence; these are not arrays as they can be changed.
It does not have any character type because characters can be constituted by strings having a length of 1. For example, in JSON format, the string value has been constituted as “hii.”

The PFA expressions have been constituted with string as:

String Type

The “init” section can accept the value as JSON.

6. Byte Types

This type can be represented as “bytes” it can allow any byte sequence; it does not have any sub-type, so we can call it the generality of string. It does not take an array, and it cannot be changeable.

In JSON, the value of “string” is like: “hi.”

In PFA expression, it has been allowed using either base-64 or as an envelope string, such as:

Byte Types

7. Array

It is an analogous assembly of items in the ordered form; if we have y type, then that can be accomplished as:

Avro Data Types 6

An example of an array of strings written as:

Avro Data Types 7

If the array contains a mixed type of items, they have to be declared as a union; an array of a nullable and floating-point number is:

Avro Data Types 8

If we try to extract from the above array, then that item has been distributed to control “null” and “double.”

If the item may have any type, then we can able to establish a two-dimensional array in an array of arrays, such as:

Avro Data Types 9

In JSON format, an array object can be written in a square bracket as:

Avro Data Types 10

That has been written in PFA format as:

Avro Data Types 11

8. Maps

Maps are analogous; disordered key-value pairs with keys are strings if the array has an index(key) as a string, preferably the integer.
If we have a type y, then we can able to map from string to ‘y’, such as:
Maps

Examples of a map from a string to a floating-point number such:

Avro Data Types 13

It has the same rules as array have, as they are not changeable:

In JSON, a map object can be written as:

Avro Data Types 14

PFA expression:

Avro Data Types 15

9. Records

These are similar to maps, as it is a group of fixed-set fields, for example:

Records

Record in JSON has been represented as:

Avro Data Types 17

For example, the above record can be represented as:

Avro Data Types 18

A particular record type can be defined once per PFA document in which the record is fully-qualified.

Record type example: binary tree with string as leaves:

Avro Data Types 19

Recursive record of providing the array or map as subfields:

Avro Data Types 20

Records have PFA values.

10. Enumeration Sets

Enumeration sets are described as “enums,” which have a limited set of strings, and the string has to be in avro names, such as given below:

Enumeration Sets

Example of having six symbols:

Avro Data Types 22

The ‘name’ field is mandatory, ‘namespace’ is optional, and a particular enum type can only be defined per the PFA document. In JSON, the enum value can be represented by the symbol name.

PFA can utilize the enum sets for describing the fixed set of variables; for example above six symbols have been sorted as:

Avro Data Types 23

Not as,

Avro Data Types 24

11. Fixed-width Byte Sequences

Avro can support the name as raw byte series having fixed-length, in which the 6-byte mac address has been described as:

Fixed-width Byte Sequences

As we have three named types, the ‘name’ field is mandatory and ‘namespace’ is optional; firstly, these are not deliberated for compact fill up in the serialization of the avro and are not explicitly helpful in PFA.

12. Tagged Unions

Avro and PFA have tagged unions, so the particular type of values is available; the union of M, N, and O has been represented as a list:

Avro Data Types 26

For example, has variable “null,” “string,” or a map of “int” as:

“null”, “string”, or a map

At least two types are required, types are not repeated, and they are not nested directly.

Conclusion

In this article, we conclude that the avro can define data type which can use the string and JSON objects as it can have the above set of a data type with different forms and expressions, so this article will help understand the concept of avro data type.

Recommended Articles

This is a guide to Avro Data Types. Here we discuss the introduction and list of avro data types for better understanding. You may also have a look at the following articles to learn more –

  1. Visual Testing Tools
  2. Application Monitoring Tools
  3. Network Monitoring Tools
  4. Kali Linux Tools

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW