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

Enum schema exhibits same restriction to enum symbols as to names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.7
    • 1.8.0
    • java
    • None

    Description

      EnumSchema class in org.apache.avro.Schema has the following code:

      for (String symbol : symbols)
      if (ordinals.put(validateName(symbol), i++) != null)

      which validates enum symbols using validateName() which makes impossible to use symbols that are not conforming to standard for real names.
      That prohibits using of symbols like "" (empty string) or anything starting with number which does not seem to be intended.

      I guess this place requires either some another type of validation or no validation at all. Can provide a patch for both cases.

      Attachments

        1. AVRO-1725.patch
          1 kB
          Martin Kleppmann

        Issue Links

          Activity

            People

              Unassigned Unassigned
              whale2 Nikita Makeev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: