Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/2844#issuecomment-59643838
It looks like this build is going to fail a ReplSuite test:
```scala
test("broadcast vars") {
// Test that the value that a broadcast var had when it was created is
used,
// even if that variable is then modified in the driver program
// TODO: This doesn't actually work for arrays when we run in local
mode!
val output = runInterpreter("local",
"""
|var array = new Array[Int](5)
|val broadcastArray = sc.broadcast(array)
|sc.parallelize(0 to 4).map(x => broadcastArray.value(x)).collect
|array(0) = 5
|sc.parallelize(0 to 4).map(x => broadcastArray.value(x)).collect
""".stripMargin)
assertDoesNotContain("error:", output)
assertDoesNotContain("Exception", output)
assertContains("res0: Array[Int] = Array(0, 0, 0, 0, 0)", output)
assertContains("res2: Array[Int] = Array(5, 0, 0, 0, 0)", output)
}
```
I see now that my change to remove the special local-mode handling
inadvertently leads to a duplication of the variable in the driver program.
This could maybe be a performance issue, since now we will use 2x the memory in
the driver for each broadcast variable. I'll restore the line that stores the
local copy of the broadcast variable when it's created.
---
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]