Avro: org.apache.avro.AvroTypeException: Expected long. Got START_OBJECT

Solution 1:

You only need the type object if the type is unclear (union of string or number, for example), or its nullable.

For batchId and runRefId, just use simple values