[
https://issues.apache.org/jira/browse/BEAM-5866?focusedWorklogId=160967&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-160967
]
ASF GitHub Bot logged work on BEAM-5866:
----------------------------------------
Author: ASF GitHub Bot
Created on: 31/Oct/18 03:59
Start Date: 31/Oct/18 03:59
Worklog Time Spent: 10m
Work Description: reuvenlax commented on issue #6845: [BEAM-5866] Fix
`Row#equals`
URL: https://github.com/apache/beam/pull/6845#issuecomment-434553127
Changing Row.get to return StructuralByteArray instead of byte[] will
probably require some changes to the byte-buddy generated code.
On Sat, Oct 27, 2018 at 3:18 PM Kenn Knowles <[email protected]>
wrote:
> Whatever implementation we use, it has to have the same semantics as the
> custom deep equals. Two rows are equal if they are observably the same when
> limited to the properties of the type in their schema. The representation
> should be able to change. We can ignore Java's broken array equality except
> as an example of something to not do. And since this equality is already
> going to be consistent with serialization-based shuffling, we shouldn't
> need structural value (I'm OK with it, but it is surprising to need it). I
> am surprised, and sort of not believing, that a schema-driven deep equality
> could be slower than a recursive structuralValue. And I also think that it
> is possible to have correct semantics with good performance.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/beam/pull/6845#issuecomment-433659607>, or mute
> the thread
>
<https://github.com/notifications/unsubscribe-auth/AUGE1Y428L6jdEOaxFIspySqqBRZ-VtJks5upNupgaJpZM4X8DkU>
> .
>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 160967)
Time Spent: 6h (was: 5h 50m)
> RowCoder doesn't implement structuralValue
> ------------------------------------------
>
> Key: BEAM-5866
> URL: https://issues.apache.org/jira/browse/BEAM-5866
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Gleb Kanterov
> Assignee: Gleb Kanterov
> Priority: Major
> Time Spent: 6h
> Remaining Estimate: 0h
>
> These two properties fail for RowCoder with `BYTES` field, or `Map<BYTES, ?>`
> field.
> {code}
> public static <T> void testConsistentWithEquals(Coder<T> coder, T example) {
> assumeTrue(coder.consistentWithEquals());
> byte[] bytes = encodeBytes(coder, example);
> // even if the coder is non-deterministic, if the encoded bytes match,
> // coder is consistent with equals, decoded values must be equal
> T out0 = decodeBytes(coder, bytes);
> T out1 = decodeBytes(coder, bytes);
> assertEquals("If the encoded bytes match, decoded values must be equal",
> out0, out1);
> assertEquals(
> "If two values are equal, their hash codes must be equal",
> out0.hashCode(),
> out1.hashCode());
> }
> public static <T> void testStructuralValueConsistentWithEquals(Coder<T>
> coder, T example) {
> byte[] bytes = encodeBytes(coder, example);
> // even if coder is non-deterministic, if the encoded bytes match,
> // structural values must be equal
> Object out0 = coder.structuralValue(decodeBytes(coder, bytes));
> Object out1 = coder.structuralValue(decodeBytes(coder, bytes));
> assertEquals("If the encoded bytes match, structural values must be
> equal", out0, out1);
> assertEquals(
> "If two values are equal, their hash codes must be equal",
> out0.hashCode(),
> out1.hashCode());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)