It should be two lines of code here using PartitionwiseSampledRDD. So do we still need FoldedRDD and CompositeFoldedRDD?