[ https://issues.apache.org/jira/browse/SPARK-14408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15227090#comment-15227090 ]
Joseph K. Bradley commented on SPARK-14408: ------------------------------------------- fold seems better to me. PairRDDFunctions.foldByKey does not explicitly say the function can modify the first argument, but comparing its implementation with aggregateByKey, I would guess it is fine. What do you think? RDD.fold should be fine, based on its docs. This seems like a difficult thing to cover in unit tests... > Is RDD.treeAggregate implemented correctly? > ------------------------------------------- > > Key: SPARK-14408 > URL: https://issues.apache.org/jira/browse/SPARK-14408 > Project: Spark > Issue Type: Question > Components: Spark Core > Reporter: Joseph K. Bradley > > **Issue** > In MLlib, we have assumed that {{RDD.treeAggregate}} allows the {{seqOp}} and > {{combOp}} functions to modify and return their first argument, just like > {{RDD.aggregate}}. However, it is not documented that way. > I started to add docs to this effect, but then noticed that {{treeAggregate}} > uses {{reduceByKey}} and {{reduce}} in its implementation, neither of which > technically allows the seq/combOps to modify and return their first arguments. > **Question**: Is the implementation safe, or does it need to be updated? -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org