Dataframe, Datasets, Rdd.
employ.name).foreach(println) <console>:26: error: value name is not a member of org.apache.spark.sql.Row It gives an error, value name is not a member of Row object. So, in this case DataFrame couldn’t preserve schema. Now let’s see what happen when we do same thing with Dataset. val