[
https://issues.apache.org/jira/browse/BEAM-6812?focusedWorklogId=213345&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-213345
]
ASF GitHub Bot logged work on BEAM-6812:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Mar/19 18:51
Start Date: 14/Mar/19 18:51
Worklog Time Spent: 10m
Work Description: jhalaria commented on pull request #8042: [BEAM-6812]:
Create a custom hash partitioner that deals with arrays during spark combines
URL: https://github.com/apache/beam/pull/8042#discussion_r265718773
##########
File path:
runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java
##########
@@ -146,20 +147,40 @@
JavaPairRDD<K, WindowedValue<KV<K, InputT>>> inRddDuplicatedKeyPair =
rdd.mapToPair(TranslationUtils.toPairByKeyInWindowedValue());
- JavaPairRDD<K, SerializableAccumulator<KV<K, AccumT>>> accumulatedResult =
- inRddDuplicatedKeyPair.combineByKey(
- input ->
-
SerializableAccumulator.of(sparkCombineFn.createCombiner(input),
iterAccumCoder),
- (acc, input) ->
- SerializableAccumulator.of(
- sparkCombineFn.mergeValue(input,
acc.getOrDecode(iterAccumCoder)),
- iterAccumCoder),
- (acc1, acc2) ->
- SerializableAccumulator.of(
- sparkCombineFn.mergeCombiners(
- acc1.getOrDecode(iterAccumCoder),
acc2.getOrDecode(iterAccumCoder)),
- iterAccumCoder));
+ JavaPairRDD<K, SerializableAccumulator<KV<K, AccumT>>> accumulatedResult;
+ if (partitioner == null) {
Review comment:
I don't really like doing this null check and calling different functions
`combineByKey` function based on whether the `partitioner` is present or not. I
can change the `getPartitioner` function to always return a partitioner and
then this way I don't have to do this check here. Thoughts @iemejia ?
----------------------------------------------------------------
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: 213345)
Time Spent: 50m (was: 40m)
> 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: 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)