Add mapPartitionsWithIndex

Add mapPartitionsWithIndex