Spark Calculate Number Of Partitions