[jira] [Updated] (AVRO-2058) ReflectData#isNonStringMap returns true for Utf8 keys
[ https://issues.apache.org/jira/browse/AVRO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp updated AVRO-2058: -- Resolution: Fixed Fix Version/s: 1.9.0 Status: Resolved (was: Patch Available) > ReflectData#isNonStringMap returns true for Utf8 keys > - > > Key: AVRO-2058 > URL: https://issues.apache.org/jira/browse/AVRO-2058 > Project: Apache Avro > Issue Type: Bug > Components: java >Affects Versions: 1.8.2 >Reporter: Sam Schlegel >Assignee: Sam Schlegel >Priority: Critical > Fix For: 1.9.0 > > Attachments: AVRO-2058.patch > > > Since {{Utf8}} does not have an {{Stringable}} notation, and is not in > {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns > true. This also causes {{ReflectData#isArray}} to return true for maps with > Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This > ultimately causes {{ReflectData#write}} to fail for schemas that contain a > union that contains a map, where the data uses Utf8 for strings. > This following test case reproduces the issue: > {code:java} > @Test public void testUnionWithMapWithUtf8Keys() { > Schema s = new Schema.Parser().parse > ("[\"null\", {\"type\":\"map\",\"values\":\"float\"}]"); > GenericData data = ReflectData.get(); > HashMap map = new HashMap(); > map.put(new Utf8("foo"), 1.0f); > assertEquals(1, data.resolveUnion(s, map)); > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (AVRO-2058) ReflectData#isNonStringMap returns true for Utf8 keys
[ https://issues.apache.org/jira/browse/AVRO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Schlegel updated AVRO-2058: --- Status: Patch Available (was: Open) > ReflectData#isNonStringMap returns true for Utf8 keys > - > > Key: AVRO-2058 > URL: https://issues.apache.org/jira/browse/AVRO-2058 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.8.2 >Reporter: Sam Schlegel >Priority: Critical > Attachments: AVRO-2058.patch > > > Since {{Utf8}} does not have an {{Stringable}} notation, and is not in > {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns > true. This also causes {{ReflectData#isArray}} to return true for maps with > Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This > ultimately causes {{ReflectData#write}} to fail for schemas that contain a > union that contains a map, where the data uses Utf8 for strings. > This following test case reproduces the issue: > {code:java} > @Test public void testUnionWithMapWithUtf8Keys() { > Schema s = new Schema.Parser().parse > ("[\"null\", {\"type\":\"map\",\"values\":\"float\"}]"); > GenericData data = ReflectData.get(); > HashMapmap = new HashMap (); > map.put(new Utf8("foo"), 1.0f); > assertEquals(1, data.resolveUnion(s, map)); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2058) ReflectData#isNonStringMap returns true for Utf8 keys
[ https://issues.apache.org/jira/browse/AVRO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Schlegel updated AVRO-2058: --- Description: Since {{Utf8}} does not have an {{Stringable}} notation, and is not in {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns true. This also causes {{ReflectData#isArray}} to return true for maps with Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This ultimately causes {{ReflectData#write}} to fail for schemas that contain a union that contains a map, where the data uses Utf8 for strings. This following test case reproduces the issue: {code:java} @Test public void testUnionWithMapWithUtf8Keys() { Schema s = new Schema.Parser().parse ("[\"null\", {\"type\":\"map\",\"values\":\"float\"}]"); GenericData data = ReflectData.get(); HashMapmap = new HashMap (); map.put(new Utf8("foo"), 1.0f); assertEquals(1, data.resolveUnion(s, map)); } {code} was:Since {{Utf8}} does not have an {{Stringable}} notation, and is not in {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns true. This also causes {{ReflectData#isArray}} to return true for maps with Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This ultimately causes {{ReflectData#write}} to fail for schemas that contain a union that contains a map, where the data uses Utf8 for strings. > ReflectData#isNonStringMap returns true for Utf8 keys > - > > Key: AVRO-2058 > URL: https://issues.apache.org/jira/browse/AVRO-2058 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.8.2 >Reporter: Sam Schlegel >Priority: Critical > > Since {{Utf8}} does not have an {{Stringable}} notation, and is not in > {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns > true. This also causes {{ReflectData#isArray}} to return true for maps with > Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This > ultimately causes {{ReflectData#write}} to fail for schemas that contain a > union that contains a map, where the data uses Utf8 for strings. > This following test case reproduces the issue: > {code:java} > @Test public void testUnionWithMapWithUtf8Keys() { > Schema s = new Schema.Parser().parse > ("[\"null\", {\"type\":\"map\",\"values\":\"float\"}]"); > GenericData data = ReflectData.get(); > HashMap map = new HashMap (); > map.put(new Utf8("foo"), 1.0f); > assertEquals(1, data.resolveUnion(s, map)); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (AVRO-2058) ReflectData#isNonStringMap returns true for Utf8 keys
[ https://issues.apache.org/jira/browse/AVRO-2058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Schlegel updated AVRO-2058: --- Description: Since {{Utf8}} does not have an {{Stringable}} notation, and is not in {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns true. This also causes {{ReflectData#isArray}} to return true for maps with Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This ultimately causes {{ReflectData#write}} to fail for schemas that contain a union that contains a map, where the data uses Utf8 for strings. (was: Since {{org.apache.avro.util.Utf8}} does not have an {{org.apache.reflect.Stringable}} notation, and is not in {{org.apache.avro.specific.SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns true. This also causes {{ReflectData#isArray}} to return true for maps with Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This ultimately causes {{ReflectData#write}} to fail for schemas that contain a union that contains a map, where the data uses Utf8 for strings.) Summary: ReflectData#isNonStringMap returns true for Utf8 keys (was: ReflectData#isNonStringMap returns true for org.apache.avro.util.Utf8 keys) > ReflectData#isNonStringMap returns true for Utf8 keys > - > > Key: AVRO-2058 > URL: https://issues.apache.org/jira/browse/AVRO-2058 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.8.2 >Reporter: Sam Schlegel >Priority: Critical > > Since {{Utf8}} does not have an {{Stringable}} notation, and is not in > {{SpecificData#stringableClasses}}, {{ReflectData#isNonStringMap}} returns > true. This also causes {{ReflectData#isArray}} to return true for maps with > Utf8 keys, and thus {{GenericData#resolveUnion}} fails as well. This > ultimately causes {{ReflectData#write}} to fail for schemas that contain a > union that contains a map, where the data uses Utf8 for strings. -- This message was sent by Atlassian JIRA (v6.4.14#64029)