You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Joe Gamache (JIRA)" <ji...@apache.org> on 2012/05/22 17:21:41 UTC

[jira] [Created] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.

Joe Gamache created AVRO-1100:
---------------------------------

             Summary: ResolveUnion in 1.6.3 thinks a HashMap is a Record.
                 Key: AVRO-1100
                 URL: https://issues.apache.org/jira/browse/AVRO-1100
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.6.3
         Environment: Windows, eclipse
            Reporter: Joe Gamache
         Attachments: IntegerMap.java, ReflectDataTest.java

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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.

Posted by "Joe Gamache (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286674#comment-13286674 ] 

Joe Gamache commented on AVRO-1100:
-----------------------------------

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?

                
> ResolveUnion in 1.6.3 thinks a HashMap is a Record.
> ---------------------------------------------------
>
>                 Key: AVRO-1100
>                 URL: https://issues.apache.org/jira/browse/AVRO-1100
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Windows, eclipse
>            Reporter: Joe Gamache
>         Attachments: IntegerMap.java, ReflectDataTest.java
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.

Posted by "Joe Gamache (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Gamache updated AVRO-1100:
------------------------------

    Attachment: ReflectDataTest.java
                IntegerMap.java
    
> ResolveUnion in 1.6.3 thinks a HashMap is a Record.
> ---------------------------------------------------
>
>                 Key: AVRO-1100
>                 URL: https://issues.apache.org/jira/browse/AVRO-1100
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Windows, eclipse
>            Reporter: Joe Gamache
>         Attachments: IntegerMap.java, ReflectDataTest.java
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281896#comment-13281896 ] 

Doug Cutting commented on AVRO-1100:
------------------------------------

Is this the same problem as AVRO-1056?
                
> ResolveUnion in 1.6.3 thinks a HashMap is a Record.
> ---------------------------------------------------
>
>                 Key: AVRO-1100
>                 URL: https://issues.apache.org/jira/browse/AVRO-1100
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Windows, eclipse
>            Reporter: Joe Gamache
>         Attachments: IntegerMap.java, ReflectDataTest.java
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13293145#comment-13293145 ] 

Doug Cutting commented on AVRO-1100:
------------------------------------

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!
                
> ResolveUnion in 1.6.3 thinks a HashMap is a Record.
> ---------------------------------------------------
>
>                 Key: AVRO-1100
>                 URL: https://issues.apache.org/jira/browse/AVRO-1100
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Windows, eclipse
>            Reporter: Joe Gamache
>         Attachments: IntegerMap.java, ReflectDataTest.java
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira