Given an Avro record with schema:
[{
"type": "record",
"name": "MyRecord",
"fields": [
{
"name": "foo",
"type": "string"
}
]
}]
On Avro 1.8, invoking GenericRecord#get("bar") returns null.
On Avro 1.11+, invoking GenericRecord#get("bar") throws an org.apache.avro.AvroRuntimeException: Not a valid schema field: bar.
This has a consequence for BigQueryType classes that include an optional field that's not guaranteed to exist in the BQ table. Typed BQ that specifies BigQueryIO's GenericRecord format and invokes BigQueryType#fromAvro on the resulting record will throw the AvroRuntimeException on Avro 1.11.
We could fix it by updating BigQueryType#fromAvro to check for the existence of the field in the schema before calling GenericRecord#get, if the corresponding case class field is an Option: https://github.com/spotify/scio/blob/v0.14.17/scio-google-cloud-platform/src/main/scala/com/spotify/scio/bigquery/types/ConverterProvider.scala#L134-L136