Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/5587#issuecomment-94414485
I think that's right that it would be more consistent, in that this is how
the Scala function that's ultimately called for `RDD.fold` looks:
```
def foldLeft[B](z: B)(op: (B, A) => B): B = {
var result = z
this.seq foreach (x => result = op(result, x))
result
}
```
Elements are passed as the second arguments. The operation is commutative
but it matters here since the operation is only supposed to modify the first
arg.
Why does this affect your ability to make a differently typed result? You
need `aggregate` for that anyway I thought.
CC @JoshRosen as initial author
---
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]