Recall & Review
beginner
What is an Avro schema?
An Avro schema is a JSON-based format that defines the structure of data, including fields and their types, used to serialize and deserialize data in Kafka.
Click to reveal answer
beginner
What are the main components of an Avro schema?
The main components are: <br>1. type: The data type (e.g., record, string, int).<br>2. name: The name of the record.<br>3. fields: A list of fields with their names and types.
Click to reveal answer
beginner
How do you define a record type in Avro schema?
You define a record by specifying
"type": "record", giving it a "name", and listing its "fields" with their names and types.Click to reveal answer
intermediate
What is the purpose of the
namespace in an Avro schema?The
namespace groups related schemas together, like a folder name, to avoid name conflicts between schemas with the same record name.Click to reveal answer
intermediate
How do you specify optional fields in an Avro schema?
You use a union type with
"null" and the actual type, for example: ["null", "string"]. This means the field can be a string or null (optional).Click to reveal answer
Which data type is used to define a complex structure in Avro schema?
✗ Incorrect
The 'record' type defines a complex structure with multiple fields.
How do you make a field optional in Avro schema?
✗ Incorrect
Avro uses a union type with 'null' to indicate optional fields.
What is the purpose of the 'namespace' in an Avro schema?
✗ Incorrect
Namespace helps organize schemas and prevent name clashes.
Which format is used to write Avro schemas?
✗ Incorrect
Avro schemas are written in JSON format.
What does the 'fields' array in an Avro schema contain?
✗ Incorrect
The 'fields' array defines each field's name and type.
Explain how to define a simple Avro schema for a user record with name (string) and age (int).
Think about the 'type', 'name', and 'fields' keys.
You got /4 concepts.
Describe how to make a field optional in an Avro schema and why it is useful.
Consider how to allow a field to be missing or null.
You got /3 concepts.