Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Duplicate
-
1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0
-
None
-
None
Description
At this moment fold method reverses an order of arguments and places accumulator on the RHS.
def func(iterator):
acc = zeroValue
for obj in iterator:
acc = op(obj, acc)
yield acc
It is confusing (see linked SO question), clearly conflicts with documentation:
The function op(t1, t2) is allowed to modify t1 and return it as its result value to avoid object allocation; however, it should not modify t2
and may become a bug if implementation changes.
Attachments
Issue Links
- duplicates
-
SPARK-7683 Confusing behavior of fold function of RDD in pyspark
- Resolved