Dataset
As Scala developers, we are used to working with types and with a friendly compiler that infers types and tells us our mistakes. The problem with DataFrame API and Spark SQL is that you can write a query such as Select lastname From people, but in your DataFrame, you might not have a lastname column, but surname one. In this case, you are only going to discover that mistake at runtime with a nasty exception!
Wouldn't it be nice to have a compilation error instead?
This is why Spark introduced Dataset in version 1.6. Dataset attempts to unify the RDD and the DataFrame APIs. Dataset has a type parameter, and you can use anonymous functions to manipulate the data as you would with an RDD or a vector.
Actually, DataFrame is, in fact, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access