Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/11628#discussion_r56133820
--- Diff: core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala ---
@@ -50,6 +50,29 @@ class PipedRDDSuite extends SparkFunSuite with
SharedSparkContext {
}
}
+ test("failure in iterating over pipe input") {
+ if (testCommandAvailable("cat")) {
+ val nums =
+ sc.makeRDD(Array(1, 2, 3, 4), 2)
+ .mapPartitionsWithIndex((index, iterator) => {
+ new Iterator[Int] {
+ def hasNext = true
+ def next() = {
+ throw new SparkException("Exception to simulate bad
scenario")
+ }
+ }
+ })
+
+ val piped = nums.pipe(Seq("cat"))
+
+ intercept[SparkException] {
+ piped.collect()
+ }
+ } else {
+ assert(true)
--- End diff --
This can be removed?
Also in the test above, we need to assert that an exception was thrown, not
just not-fail if it was thrown. Otherwise it passes if no exception is throw
from `collect()`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]