spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maciej Szymkiewicz (JIRA)" <>
Subject [jira] [Created] (SPARK-12595) fold should pass arguments to op in the correct order
Date Fri, 01 Jan 2016 10:46:39 GMT
Maciej Szymkiewicz created SPARK-12595:

             Summary: fold should pass arguments to op in the correct order
                 Key: SPARK-12595
             Project: Spark
          Issue Type: Bug
          Components: PySpark
    Affects Versions: 1.5.0, 1.4.0, 1.3.0, 1.2.0, 1.1.0, 1.0.0, 1.6.0
            Reporter: Maciej Szymkiewicz
            Priority: Trivial

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. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message