GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/9655
[SPARK-11687] Mixed usage of fold and foldLeft, reduce and reduceLeft and
reduceOption and reduceLeftOption
https://issues.apache.org/jira/browse/SPARK-11687
As can be seen here
https://github.com/scala/scala/blob/2.12.x/src/library/scala/collection/TraversableOnce.scala,
`fold`, `reduce` and `reduceOption` came out from scala 2.9.x. In addition,
all the implementations of `fold`, `reduce` and `reduceOption` call actually
`foldLeft`, `reduceLeft` and `reduceLeftOption` directly without any additional
codes.
For developers who are not used to scala, the mixed usages of them might
leave a question, for example, if it works as reduceRight or reduceLeft (as all
know, the direction can change the results).
Even some usages can be found where they work identically the same things.
This is just a little nit but I think it would be better to use only
`xxxLeft` for readability.
Fortunately, there are not so many usages of `xxx` so in this PR, I changed
them to `xxxLeft`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-11687
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/9655.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #9655
----
commit 7949222219ffdba242595bf3ad14dd9c53f68b82
Author: hyukjinkwon <[email protected]>
Date: 2015-11-12T07:19:35Z
[SPARK-11687][SQL] Mixed usage of fold and foldLeft, reduce and reduceLeft
and reduceOption and reduceLeftOption
----
---
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]