CCDAK practice question 18 of 25
Which is an optional field in an Avro record?
Full set: 150 questionsAccording to the official Apache Avro specification, a record schema is a JSON object that must contain a name and a fields attribute. The doc attribute, which is a JSON string for documentation purposes, is explicitly defined as optional. Its presence or absence has no effect on the data serialization or deserialization logic; it serves only as human-readable metadata. While the namespace attribute is also optional, it has a functional impact by defining the fully qualified name of the record, which is crucial for schema evolution and avoiding naming collisions. Therefore, doc is a purely optional, non-functional field.
B. name: This is a required JSON string that provides the name of the record. A record schema is invalid without it.
C. namespace: While technically optional, this field is functionally significant as it qualifies the record's name to create a unique full name, which is critical for schema management.
D. fields: This is a required JSON array that lists all the fields within the record. A record definition is incomplete without it.
1. Apache Avro™ 1.11.1 Specification, Schemas, Record: The official specification defines the structure of a record. It states: "A record is a JSON object with the following attributes: ... name: a JSON string providing the name of the record (required). ... doc: a JSON string providing documentation to the user of this schema (optional). ... fields: a JSON array, listing fields (required)."
Source: Apache Avro Documentation, https://avro.apache.org/docs/1.11.1/specification/#records
2. Confluent Documentation, Schemas, Subjects, and Topics, Avro Schema: The Confluent documentation reinforces the Avro specification for use within the Confluent Platform. It details the required and optional components of an Avro schema, noting: "A record definition must include its type (“record”) and a name... It can also include a doc attribute to document the record."
Source: Confluent, Inc. Documentation, https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/serdes-avro.html#avro-schema (Section: Avro Schema)
Keep practicing
Take the free CCDAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCDAK practice questions
- Question 1In Avro, removing or adding a field that has a default is a __ schema evolution
- Question 2A topic has three replicas and you set min.insync.replicas to 2. If two out of three repl…
- Question 3To get acknowledgement of writes to only the leader partition, we need to use the config.…
- Question 4A customer has many consumer applications that process messages from a Kafka topic. Each …
- Question 5What information isn't stored inside of Zookeeper? (select two)
- Question 6If you enable an SSL endpoint in Kafka, what feature of Kafka will be lost?
