Given that this works:
(1 to 5).iterator.sliding(3).toList
Then why does this not work?
val rdd1 = sc.parallelize(List(1,2,3,4,5,6,7,8,9,10), 3)
val z = rdd1.iterator.sliding(3).toList
I get the following error and try to apply the fix but that does not work either!
notebook:3: error: missing argument list for method iterator in class RDD
Unapplied methods are only converted to functions when a function type is expected.
You can make this conversion explicit by writing `iterator _` or
`iterator(_,_)` instead of `iterator`.
val z = rdd1.iterator.sliding(3).toList
^
I am just trying examples and this I cannot really follow.