Is RDD's getNumPartitions a transformation or an action?
NO, If you do getNumPartition() on any RDD, It just fetches the meta(partitions.length) of an RDD and no tasks will be submitted.
My understanding about transformation is "It should return an RDD when that function applied on RDD". But getNumPartition() return integer.
Check the definition of function in RDD.scala
@Since("1.6.0")
final def getNumPartitions: Int = partitions.length
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With