Avro
  1. Avro
  2. AVRO-1100

ResolveUnion in 1.6.3 thinks a HashMap is a Record.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.3
    • Fix Version/s: None
    • Component/s: java
    • Labels:
      None
    • Environment:

      Windows, eclipse

      Description

      Getting an exception thrown on line 542 of ReflectData.java. Put a breakpoint there and found the following:

      1. Datum is a HashMap with 119 entries.
      2. If I select "getSchemaName(datum)" (line 539) and say inspect, it returns "java.util.HashMap"
      3. The "indexByName" also being accessed on line 539 =

      {map=1, null=0}

      4. In "getSchemaName" if I select "isMap(datum)" and say inspect, it returns "true" (this would then return "map" which DOES exist in the indexByName structure
      5. However, still in "getSchemaName" if I select "isRecord(datum)" and say inspect, I also get back "true". This then returns "getRecordSchema(datum).getFullName(), which is where the java.util.HashMap from item #2 comes from. Since this is not in the "indexByName" map, I get an UnresolvedUntionException.

      Either "isRecord" needs to be fixed to not return true for Maps, or the test for "isMap" at line 556 needs to moved up ahead of the test for "isRecord".

      This works fine under 1.5.4, but breaks under 1.6.3. I have a JUnit test that reproduces this, if I can figure out how to attach it , I will.

      1. IntegerMap.java
        0.4 kB
        Joe Gamache
      2. ReflectDataTest.java
        1 kB
        Joe Gamache

        Activity

        Hide
        Doug Cutting added a comment -

        Release 1.7.0, containing the fix for AVRO-1056, is now available. Can you please confirm whether you're still seeing this problem? Thanks!

        Show
        Doug Cutting added a comment - Release 1.7.0, containing the fix for AVRO-1056 , is now available. Can you please confirm whether you're still seeing this problem? Thanks!
        Hide
        Joe Gamache added a comment -

        While I think it is the same issue, I am not sure that the solution offered in the other jira is correct. Is it possible to confirm?

        Show
        Joe Gamache added a comment - While I think it is the same issue, I am not sure that the solution offered in the other jira is correct. Is it possible to confirm?
        Hide
        Doug Cutting added a comment -

        Is this the same problem as AVRO-1056?

        Show
        Doug Cutting added a comment - Is this the same problem as AVRO-1056 ?

          People

          • Assignee:
            Unassigned
            Reporter:
            Joe Gamache
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development