optional array in avro schema
问题 I'm wondering whether or not it is possible to have an optional array. Let's assume a schema like this: { "type": "record", "name": "test_avro", "fields" : [ {"name": "test_field_1", "type": "long"}, {"name": "subrecord", "type": [{ "type": "record", "name": "subrecord_type", "fields":[{"name":"field_1", "type":"long"}] },"null"] }, {"name": "simple_array", "type":{ "type": "array", "items": "string" } } ] } Trying to write an avro record without "simple_array" would result in a NPE in the