Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4696#discussion_r25598561
--- Diff: docs/programming-guide.md ---
@@ -1005,7 +1068,8 @@ for details.
</tr>
<tr>
<td> <b>foreach</b>(<i>func</i>) </td>
- <td> Run a function <i>func</i> on each element of the dataset. This is
usually done for side effects such as updating an accumulator variable (see
below) or interacting with external storage systems. </td>
+ <td> Run a function <i>func</i> on each element of the dataset. This is
usually done for side effects such as updating an accumulator variable (see
below) or interacting with external storage systems.
+ <br /><b>Note</b>: modifying variables outside of the
<code>foreach()</code> will only have the desired effect when running locally
(e.g. the spark shell) or when updating an accumulator. See <a
href="#ClosuresLink">Understanding closures </a> for more details.</td>
--- End diff --
Same, I'd describe this as undefined instead. It will not necessarily
update local variables in the driver and should be avoided.
---
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]