{
"type": "record",
"namespace": "com.example.foo",
"name": "bar",
"doc": "An example record doc field, which will be ignored by the DatumFileWriter.",
"fields": [
...
]
}
If you create a GenericRecord using the above schema and populate the fields, then use the following code to persist it to an .avro file; the doc comment from the top level record is lost.
using var datumFileWriter = DataFileWriter<GenericRecord>.OpenWriter(datumWriter, writeStream);
datumFileWriter.Append(record);
datumFileWriter.Flush();
e.g. Result (Note, schema was extracted from within .avro file's contents and fields trimmed for brevity):
According to the Avro spec (https://avro.apache.org/docs/current/spec.html#schema_record), record type should support doc comments; incidentally the python library we use for processing avro files works as expected and includes doc comments for records.
With Confluent.Apache.Avro v1.7.7.7
Given the following schema:
If you create a GenericRecord using the above schema and populate the fields, then use the following code to persist it to an .avro file; the doc comment from the top level record is lost.
e.g. Result (Note, schema was extracted from within .avro file's contents and fields trimmed for brevity):
According to the Avro spec (https://avro.apache.org/docs/current/spec.html#schema_record), record type should support doc comments; incidentally the python library we use for processing avro files works as expected and includes doc comments for records.