[
https://issues.apache.org/jira/browse/BEAM-6812?focusedWorklogId=216283&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-216283
]
ASF GitHub Bot logged work on BEAM-6812:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Mar/19 15:59
Start Date: 20/Mar/19 15:59
Worklog Time Spent: 10m
Work Description: dmvk commented on issue #8042: [BEAM-6812]: Create a
custom hash partitioner that deals with arrays during spark combines
URL: https://github.com/apache/beam/pull/8042#issuecomment-474901164
Nice catch! This problem goes way deeper, we should not ever shuffle raw
user data in the first place (we should always use beam coder to serialize
data, before partitioning even happens). If you take a look at GBK
implementation, it uses ByteArray instead of byte[] (which has correct hashCode
implementation).
I guess tests did not catch this because they use primitive types (which
spark can serialize on its own) as keys. Also tests are run in a single JVM,
therefore hashCode is stable.
Correct fix would be:
- Changing CombinePerKey implementation to convert keys to ByteArray prior
calling `combineByKey`
- In case we want to use custom partitioner, we should always check on the
first getPartition call, whether hashCode == systemIdentityHashCode and throw
an exception if it does; or make sure that we shuflle byte[] only (which may be
less expensive than ByteArray object)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: 216283)
Time Spent: 1.5h (was: 1h 20m)
> HashPartitioning on Spark with arrays as keys produces unpredictable results
> ----------------------------------------------------------------------------
>
> Key: BEAM-6812
> URL: https://issues.apache.org/jira/browse/BEAM-6812
> Project: Beam
> Issue Type: Bug
> Components: runner-spark
> Reporter: Ankit Jhalaria
> Assignee: Ankit Jhalaria
> Priority: Critical
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)