Create a decoder that always returns a single value.
For a field in the target type (the case class we are marshalling to), we must try to pull a value from the Avro GenericRecord.
For a field in the target type (the case class we are marshalling to), we must try to pull a value from the Avro GenericRecord. After the value has been retrieved, it needs to be decoded into the appropriate Scala type.
If the writer schema does not have an entry for the field then we can consider schema evolution using the following rules in the given order.
1. If the reader schema contains a default for this field, we will use that default. 2. If the parameter is defined with a scala default method then we will use that default value. 3. If the field is marked as @transient
If none of these rules can be satisfied then an exception will be thrown.
Create a decoder from a function.