Main Content
foldByKey
Class: matlab.compiler.mlspark.RDD
Namespace: matlab.compiler.mlspark
Merge the values for each key using an associative function and a neutral “zero value”
Syntax
result =
foldByKey(obj,zeroValue,func,numPartitions)
Description
merges
the values for each key in result
=
foldByKey(obj
,zeroValue
,func
,numPartitions
)obj
using an associative
function func
and a neutral “zero value”
represented by zeroValue
. The input argument numPartitions
specifies
the number of partitions to create in the resulting RDD.
Input Arguments
Output Arguments
Examples
Version History
Introduced in R2016b
See Also
fold
| aggregateByKey
| combineByKey
| groupByKey
| reduceByKey
| sortByKey
| subtractByKey
| map
| collect
| parallelize