class_docstr: Flink-customized datum reader to parse composite data structure, to fit with changed basic type
  serialization in FlinkAvroDecoder.
class_docstr_tok: ["Flink-customized","datum","reader","to","parse","composite","data","structure",",","to","fit","with","changed","basic","type","serialization","in","FlinkAvroDecoder","."]
code: def read_union(
      self, writer_schema, reader_schema, decoder: "FlinkAvroDecoder"
  ):
      index_of_schema = int(decoder.read_int())
      if index_of_schema >= len(writer_schema.schemas):
          fail_msg = (
              "Can't access branch index %d for union with %d branches"
              % (index_of_schema, len(writer_schema.schemas))
          )
          raise SchemaResolutionException(
              fail_msg, writer_schema, reader_schema
          )
      selected_writer_schema = writer_schema.schemas[index_of_schema]
  
      return self.read_data(
          selected_writer_schema, reader_schema, decoder
      )
  
imports: import struct
  from avro.io import AvroTypeException, BinaryDecoder, BinaryEncoder, DatumReader, DatumWriter, SchemaResolutionException, Validate
label_desc: Use image node_id 6 for calling the FlinkAvroDatumReader obj's underlying member method code with example usage: obj.read_union(writer_schema, reader_schema, decoder) and returns: self