spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-12595) fold should pass arguments to op in the correct order
Date Fri, 01 Jan 2016 15:44:39 GMT

     [ https://issues.apache.org/jira/browse/SPARK-12595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sean Owen resolved SPARK-12595.
-------------------------------
    Resolution: Duplicate

> fold should pass arguments to op in the correct order
> -----------------------------------------------------
>
>                 Key: SPARK-12595
>                 URL: https://issues.apache.org/jira/browse/SPARK-12595
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0
>            Reporter: Maciej Szymkiewicz
>            Priority: Trivial
>
> At this moment [fold method|https://github.com/apache/spark/blob/499ac3e69a102f9b10a1d7e14382fa191516f7b5/python/pyspark/rdd.py#L2316]
 reverses an order of arguments and places accumulator on the RHS.
> {code}
>         def func(iterator):
>             acc = zeroValue
>             for obj in iterator:
>                 acc = op(obj, acc)
>             yield acc
> {code}
> It is confusing (see linked SO question), clearly conflicts with documentation:
> {quote}
> 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
> {quote}
> and may become a bug if implementation changes. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message