Complete the code to define the type of the Avro field.
{
"name": "age",
"type": "[1]"
}The field age should be an integer, so the type is int.
Complete the code to define a nullable string field in Avro.
{
"name": "nickname",
"type": ["null", "[1]"]
}The field nickname can be missing or a string, so the type is a union of null and string.
Fix the error in the Avro schema type definition for a boolean field.
{
"name": "isActive",
"type": "[1]"
}The field isActive should be a boolean type, so the correct type is boolean.
Fill both blanks to define an Avro record with two fields: a string name and an int age.
{
"type": "record",
"name": "Person",
"fields": [
{"name": "name", "type": "[1]"},
{"name": "age", "type": "[2]"}
]
}The name field is text, so it uses string. The age field is a whole number, so it uses int.
Fill all three blanks to define an Avro schema with a record named Employee having fields: id (int), name (string), and active (boolean).
{
"type": "record",
"name": "Employee",
"fields": [
{"name": "id", "type": "[1]"},
{"name": "name", "type": "[2]"},
{"name": "active", "type": "[3]"}
]
}The id is a number without decimals, so int. The name is text, so string. The active field is true/false, so boolean.