Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-628

Unions have no getter function (avro_union_get)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • c
    • None

    Description

      The union data type has no getter function and as such, the only way to get to the data in the union is to create a struct

      typedef struct avro_union_datum_t {
      	struct avro_obj_t obj;
      	int64_t discriminant;
      	avro_datum_t value;
      } avro_union_datum_t;

      in your own include or code as the struct for this is in datum.h which is not installed with the library. In addition, there is a type warning when trying to use avro_record_get using the avro_union_datum_t.

      Ideally there would be a getter that exposes the datum in the union.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gavinmroy Gavin M. Roy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: