How can I get preview of data RDD in Spark?


I am relatively new to Spark and want to understand how I can quickly look at the data before coming up with the logic to process the data.

Please let me know if there are any APIs to do so…


Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster


Here are the samples to preview the data in RDD

//Getting count

//Getting first record

//Getting first few records