CCDAK · Question #2
Which is an optional field in an Avro record?
The correct answer is A. doc. doc is the correct answer because it is a purely descriptive, human-readable documentation string in an Avro record schema - it has no functional effect and the schema is fully valid without it. Why the distractors are wrong: B (name) is required - every Avro record must have a…
Question
Which is an optional field in an Avro record?
Options
- Adoc
- Bname
- Cnamespace
- Dfields
How the community answered
(48 responses)- A92% (44)
- B2% (1)
- C2% (1)
- D4% (2)
Explanation
doc is the correct answer because it is a purely descriptive, human-readable documentation string in an Avro record schema - it has no functional effect and the schema is fully valid without it.
Why the distractors are wrong:
- B (name) is required - every Avro record must have a name to identify the schema type; omitting it causes a schema parse error.
- D (fields) is required - it defines the actual data structure of the record; a record schema without
fieldsis invalid. - C (namespace) is technically optional in the spec, but the exam distinguishes it from
docbecausenamespaceplays a functional role (qualifying the full name to avoid conflicts), whereasdocis purely informational with zero impact on serialization or schema resolution.
Memory tip: Think of doc as a code comment - it helps humans understand the schema but changes nothing about how data is encoded or decoded, making it the one field you can always safely omit.
Topics
Community Discussion
No community discussion yet for this question.