[
https://issues.apache.org/jira/browse/BEAM-5857?focusedWorklogId=163218&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-163218
]
ASF GitHub Bot logged work on BEAM-5857:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/18 22:04
Start Date: 06/Nov/18 22:04
Worklog Time Spent: 10m
Work Description: iemejia closed pull request #6829: [BEAM-5857] Fix:
unnecessary submission of a new job when calling inp…
URL: https://github.com/apache/beam/pull/6829
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java
index f79dac2e9c1..77fc77fdb76 100644
---
a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java
+++
b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java
@@ -18,6 +18,7 @@
package org.apache.beam.runners.spark.translation;
import com.google.common.base.Optional;
+import com.google.common.collect.Iterables;
import javax.annotation.Nullable;
import org.apache.beam.runners.spark.coders.CoderHelpers;
import org.apache.beam.runners.spark.util.ByteArray;
@@ -97,10 +98,6 @@
// ---- InputT: I
JavaRDD<byte[]> inputRDDBytes =
rdd.map(CoderHelpers.toByteFunction(wviCoder));
- if (inputRDDBytes.isEmpty()) {
- return Optional.absent();
- }
-
/*Itr<WV<A>>*/
/*Itr<WV<A>>>*/
/*Itr<WV<A>>>*/
@@ -129,7 +126,10 @@
return CoderHelpers.toByteArray(merged, iterAccumCoder);
});
- return Optional.of(CoderHelpers.fromByteArray(accumulatedBytes,
iterAccumCoder));
+ final Iterable<WindowedValue<AccumT>> result =
+ CoderHelpers.fromByteArray(accumulatedBytes, iterAccumCoder);
+
+ return Iterables.isEmpty(result) ? Optional.absent() : Optional.of(result);
}
/**
----------------------------------------------------------------
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: 163218)
Time Spent: 1h 40m (was: 1.5h)
> Unnecessary submission of a new job in Combine.globally
> -------------------------------------------------------
>
> Key: BEAM-5857
> URL: https://issues.apache.org/jira/browse/BEAM-5857
> Project: Beam
> Issue Type: Bug
> Components: runner-spark
> Affects Versions: 2.7.0
> Reporter: Marek Simunek
> Assignee: Marek Simunek
> Priority: Major
> Fix For: 2.9.0
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> When calling `rdd.isEmpty()`, it submits new job, which is not optimal. This
> happens in Combine.globally translation where its
> [called|https://github.com/apache/beam/blob/master/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/GroupCombineFunctions.java#L102].
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)