Explain first() operation
-
-
Explain first() operation
-
> It is an action.
> It returns the first element of the RDD.
Example :
val rdd1 = sc.textFile("/home/hdadmin/wc-data.txt")
rdd1.count
rdd1.first
Output :
Long: 20
String : DataFlair is the leading technology training provider
for more Actions on RDD refer: Transformation and Action
- You must be logged in to reply to this topic.