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

SpecificData.java has a bug creating a schema for a map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.6.3
    • 1.7.2
    • java
    • Mac

    Description

      in the SepcificData class, the protected Schema createSchema(java.lang.reflect.Type type, Map<String,Schema> names) fails in creating a schema for the Map type.

      Looking at this excerpt,

      else if (Map.class.isAssignableFrom(raw))

      { // map java.lang.reflect.Type key = params[0]; java.lang.reflect.Type value = params[1]; if (!(type instanceof Class && CharSequence.class.isAssignableFrom((Class)type))) throw new AvroTypeException("Map key class not CharSequence: "+key); return Schema.createMap(createSchema(value, names)); }

      The type is a map, the key is a string. therefore instead of "if (Unable to render embedded object: File ((type instanceof Class" it should be "if () not found.(key instanceof Class".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              netvisao Amine R.
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: