You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Ryan Skraba (Jira)" <ji...@apache.org> on 2023/06/14 16:41:00 UTC
[jira] [Comment Edited] (AVRO-2943) Map comparison between Utf8 and String keys fails
[ https://issues.apache.org/jira/browse/AVRO-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732626#comment-17732626 ]
Ryan Skraba edited comment on AVRO-2943 at 6/14/23 4:40 PM:
------------------------------------------------------------
I've cherry-picked this to [branch-1.11|https://github.com/apache/avro/commit/204dcd1f970458b83cc54672fcddafc6056de3bc] (and [here|https://github.com/apache/avro/commit/b0f40b218cf8879fc2f62c6f01ab420b8a8215b5]).
It would be amazing if you could watch the [mailing list|https://lists.apache.org/list?dev@avro.apache.org] for the release candidate and validate it! Thanks again for your patience and the contribution.
was (Author: ryanskraba):
I've cherry-picked this to [branch-1.11|https://github.com/apache/avro/commit/204dcd1f970458b83cc54672fcddafc6056de3bc] (and [here|https://github.com/apache/avro/commit/b0f40b218cf8879fc2f62c6f01ab420b8a8215b5]).
It would be amazing if you could watch the [mailing list|https://lists.apache.org/list?dev@avro.apache.org] for the release candidate and validate it! Thanks again for your patience and the contribution.
> Map comparison between Utf8 and String keys fails
> -------------------------------------------------
>
> Key: AVRO-2943
> URL: https://issues.apache.org/jira/browse/AVRO-2943
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.10.0
> Environment: Mac OS Catalina 10.15.6
>
> openjdk version "1.8.0_265"
> OpenJDK Runtime Environment Corretto-8.265.01.1 (build 1.8.0_265-b01)
> OpenJDK 64-Bit Server VM Corretto-8.265.01.1 (build 25.265-b01, mixed mode)
> Reporter: Frank Grimes
> Assignee: Frank Grimes
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.12.0, 1.11.2
>
> Attachments: AVRO-2943-frankgrimes97.patch
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> The following test I locally added to org.apache.avro.generic.TestGenericData on master demonstrates the problem:
> {code:java}
> @Test
> public void testMapKeyEquals() {
> Schema mapSchema = new Schema.Parser().parse("{\"type\": \"map\", \"values\": \"string\"}");
> Field myMapField = new Field("my_map", Schema.createMap(mapSchema), null, null);
> Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
> schema.setFields(Arrays.asList(myMapField));
> GenericRecord r0 = new GenericData.Record(schema);
> GenericRecord r1 = new GenericData.Record(schema);
> HashMap<CharSequence, String> pair1 = new HashMap<>();
> pair1.put("keyOne", "valueOne");
> r0.put("my_map", pair1);
> HashMap<CharSequence, String> pair2 = new HashMap<>();
> pair2.put(new Utf8("keyOne"), "valueOne");
> r1.put("my_map", pair2);
> assertEquals(r0, r1);
> assertEquals(r1, r0);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)