Bird
Raised Fist0

Find the issue in this Avro schema snippet:

medium📝 Debug Q7 of Q15
Kafka - Schema Registry
Find the issue in this Avro schema snippet:
{"type": "record", "name": "Product", "fields": [{"name": "id", "type": "int"}, {"name": "tags", "type": "array"}]}
A"tags" field name is reserved
B"array" type requires an "items" attribute
C"int" is not a valid Avro type
DMissing "namespace" attribute in schema
Step-by-Step Solution
Solution:
  1. Step 1: Review array type requirements

    Avro arrays must specify the type of items with an "items" key.
  2. Step 2: Check other attributes

    Field names can be any valid string, "int" is valid, "namespace" is optional.
  3. Final Answer:

    "array" type requires an "items" attribute -> Option B
  4. Quick Check:

    Arrays need "items" type defined [OK]
Quick Trick: Always specify "items" type for arrays in Avro [OK]
Common Mistakes:
MISTAKES
  • Omitting "items" for array types
  • Confusing optional and required schema attributes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes