Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/11217#issuecomment-184692578
They don't need to be since `fold` will operate on the input in some order.
Spark's `fold` is built on `Iterator.fold` which would naturally apply the
operator in a fixed order from first to last, so commutativity does not matter.
See its doc:
http://www.scala-lang.org/api/2.11.7/index.html#scala.collection.Iterator ;
most Spark docs for `fold` methods do not mention commutativity either.
The scaladoc does mention the non-trivial things that happen if it's not
commutative, but it's not required.
---
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]