This repo contains code samples in both Java and Scala for dealing with Apache Spark's RDD, DataFrame, and Dataset APIs and highlights the differences in approach between these APIs.
For more information, see the following blog post:
http://www.agildata.com/apache-spark-rdd-vs-dataframe-vs-dataset/