@@ -91,8 +91,8 @@ setMethod("initialize", "PipelinedRDD", function(.Object, prev, func, jrdd_val)
9191 # NOTE: We use prev_serializedMode to track the serialization mode of prev_JRDD
9292 # prev_serializedMode is used during the delayed computation of JRDD in getJRDD
9393 } else {
94- pipelinedFunc <- function (split , iterator ) {
95- func(split , prev @ func(split , iterator ))
94+ pipelinedFunc <- function (partIndex , part ) {
95+ func(partIndex , prev @ func(partIndex , part ))
9696 }
9797 .Object @ func <- cleanClosure(pipelinedFunc )
9898 .Object @ prev_jrdd <- prev @ prev_jrdd # maintain the pipeline
@@ -306,7 +306,7 @@ setMethod("numPartitions",
306306 signature(x = " RDD" ),
307307 function (x ) {
308308 jrdd <- getJRDD(x )
309- partitions <- callJMethod(jrdd , " splits " )
309+ partitions <- callJMethod(jrdd , " partitions " )
310310 callJMethod(partitions , " size" )
311311 })
312312
@@ -452,8 +452,8 @@ setMethod("countByValue",
452452setMethod ("lapply ",
453453 signature(X = " RDD" , FUN = " function" ),
454454 function (X , FUN ) {
455- func <- function (split , iterator ) {
456- lapply(iterator , FUN )
455+ func <- function (partIndex , part ) {
456+ lapply(part , FUN )
457457 }
458458 lapplyPartitionsWithIndex(X , func )
459459 })
@@ -538,8 +538,8 @@ setMethod("mapPartitions",
538538# '\dontrun{
539539# ' sc <- sparkR.init()
540540# ' rdd <- parallelize(sc, 1:10, 5L)
541- # ' prod <- lapplyPartitionsWithIndex(rdd, function(split , part) {
542- # ' split * Reduce("+", part) })
541+ # ' prod <- lapplyPartitionsWithIndex(rdd, function(partIndex , part) {
542+ # ' partIndex * Reduce("+", part) })
543543# ' collect(prod, flatten = FALSE) # 0, 7, 22, 45, 76
544544# '}
545545# ' @rdname lapplyPartitionsWithIndex
@@ -813,7 +813,7 @@ setMethod("distinct",
813813# ' @examples
814814# '\dontrun{
815815# ' sc <- sparkR.init()
816- # ' rdd <- parallelize(sc, 1:10) # ensure each num is in its own split
816+ # ' rdd <- parallelize(sc, 1:10)
817817# ' collect(sampleRDD(rdd, FALSE, 0.5, 1618L)) # ~5 distinct elements
818818# ' collect(sampleRDD(rdd, TRUE, 0.5, 9L)) # ~5 elements possibly with duplicates
819819# '}
@@ -825,14 +825,14 @@ setMethod("sampleRDD",
825825 function (x , withReplacement , fraction , seed ) {
826826
827827 # The sampler: takes a partition and returns its sampled version.
828- samplingFunc <- function (split , part ) {
828+ samplingFunc <- function (partIndex , part ) {
829829 set.seed(seed )
830830 res <- vector(" list" , length(part ))
831831 len <- 0
832832
833833 # Discards some random values to ensure each partition has a
834834 # different random seed.
835- runif(split )
835+ runif(partIndex )
836836
837837 for (elem in part ) {
838838 if (withReplacement ) {
@@ -989,8 +989,8 @@ setMethod("coalesce",
989989 function (x , numPartitions , shuffle = FALSE ) {
990990 numPartitions <- numToInt(numPartitions )
991991 if (shuffle || numPartitions > SparkR :: numPartitions(x )) {
992- func <- function (s , part ) {
993- set.seed(s ) # split as seed
992+ func <- function (partIndex , part ) {
993+ set.seed(partIndex ) # partIndex as seed
994994 start <- as.integer(sample(numPartitions , 1 ) - 1 )
995995 lapply(seq_along(part ),
996996 function (i ) {
@@ -1035,7 +1035,7 @@ setMethod("saveAsObjectFile",
10351035# ' Save this RDD as a text file, using string representations of elements.
10361036# '
10371037# ' @param x The RDD to save
1038- # ' @param path The directory where the splits of the text file are saved
1038+ # ' @param path The directory where the partitions of the text file are saved
10391039# ' @examples
10401040# '\dontrun{
10411041# ' sc <- sparkR.init()
@@ -1335,10 +1335,10 @@ setMethod("zipWithUniqueId",
13351335 function (x ) {
13361336 n <- numPartitions(x )
13371337
1338- partitionFunc <- function (split , part ) {
1338+ partitionFunc <- function (partIndex , part ) {
13391339 mapply(
13401340 function (item , index ) {
1341- list (item , (index - 1 ) * n + split )
1341+ list (item , (index - 1 ) * n + partIndex )
13421342 },
13431343 part ,
13441344 seq_along(part ),
@@ -1382,11 +1382,11 @@ setMethod("zipWithIndex",
13821382 startIndices <- Reduce(" +" , nums , accumulate = TRUE )
13831383 }
13841384
1385- partitionFunc <- function (split , part ) {
1386- if (split == 0 ) {
1385+ partitionFunc <- function (partIndex , part ) {
1386+ if (partIndex == 0 ) {
13871387 startIndex <- 0
13881388 } else {
1389- startIndex <- startIndices [[split ]]
1389+ startIndex <- startIndices [[partIndex ]]
13901390 }
13911391
13921392 mapply(
0 commit comments