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

writing unions with multiple records, fixed or enums can choose wrong branch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.4.0
    • 1.5.0
    • java
    • None

    Description

      According to the specification, a union may contain multiple instances of a named type, provided they have different names. There are several bugs in the Java implementation of this when writing data:

      • for record, only the short-name of the record is checked, so the branch for a record of the same name in a different namespace may be used by mistake
      • for enum and fixed, the name of the record is not checked, so the first enum or fixed in the union will always be assumed when writing. in many cases this may cause the wrong data to be written, potentially corrupting output.

      This is not a regression. This has never been implemented correctly by Java. Python and Ruby never check names, but rather perform a full, recursive validation of content.

      Attachments

        1. AVRO-656.patch
          2 kB
          Doug Cutting
        2. AVRO-656.patch
          10 kB
          Doug Cutting
        3. AVRO-656.patch
          22 kB
          Doug Cutting
        4. AVRO-656.patch
          22 kB
          Doug Cutting
        5. AVRO-656.patch
          22 kB
          Doug Cutting
        6. AVRO-656.patch
          26 kB
          Doug Cutting
        7. AVRO-656.patch
          26 kB
          Doug Cutting

        Issue Links

          Activity

            People

              cutting Doug Cutting
              cutting Doug Cutting
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: