Hi Anh, It looks like that you've found an inconsistency in the docs there. I think we need to update the docs, and state that an int is being written.
Stay strong! Cheers, Fokko Op vr 20 mrt. 2020 om 07:58 schreef Anh Le <anhl...@gmail.com>: > Hi guys, > > I'm reading the current Avro Spec. It states that: > > > A union is encoded by first writing a long value indicating the > zero-based position within the union of the schema of its value. The value > is then encoded per the indicated schema within the union. > > But as I dive through the code base, for example: > https://github.com/rdblue/avro-java/blob/master/avro/src/main/java/org/apache/avro/generic/GenericDatumWriter.java#L123-L125, > I see there's no long value here. We've got an Int instead. > > Would you please tell me if there's any misunderstanding here. > > Thank you (and be strong)! >