[ https://issues.apache.org/jira/browse/BEAM-6812?focusedWorklogId=216433&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-216433 ]
ASF GitHub Bot logged work on BEAM-6812: ---------------------------------------- Author: ASF GitHub Bot Created on: 20/Mar/19 19:49 Start Date: 20/Mar/19 19:49 Worklog Time Spent: 10m Work Description: jhalaria commented on pull request #8042: [BEAM-6812]: Convert keys to ByteArray in Combine.perKey to make sure hashCode is consistent URL: https://github.com/apache/beam/pull/8042#discussion_r267517341 ########## File path: runners/spark/src/main/java/org/apache/beam/runners/spark/translation/TransformTranslator.java ########## @@ -569,8 +569,8 @@ private static Partitioner getPartitioner(EvaluationContext context) { Long bundleSize = context.getSerializableOptions().get().as(SparkPipelineOptions.class).getBundleSize(); return (bundleSize > 0) - ? null - : new HashPartitioner(context.getSparkContext().defaultParallelism()); + ? new HashPartitioner(context.getSparkContext().defaultParallelism()) + : null; Review comment: I see. I reverted back the changes made to `getPartition` ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 216433) Time Spent: 2h 20m (was: 2h 10m) > Convert keys to ByteArray in Combine.perKey for Spark > ----------------------------------------------------- > > 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: 2h 20m > Remaining Estimate: 0h > > * During calls to Combine.perKey, we want they keys used to have consistent > hashCode when invoked from different JVM's. > * However, while testing this in our company we found out that when using > protobuf as keys during combine, the hashCodes can be different for the same > key when invoked from different JVMs. This results in duplicates. > * `ByteArray` class in Spark has a stable has code when dealing with arrays > as well. > * GroupByKey correctly converts keys to `ByteArray` and uses coders for > serialization. > * The fix does something similar when dealing with combines. -- This message was sent by Atlassian JIRA (v7.6.3#76005)