Using SQL in Spark
Using Spark SQL to profile data is useful when we want to do basic data profiling, or we want to dig into a specific aspect of our source dataset. This recipe will teach you some techniques to get some quick and dirty data profiling reports. We will use an open dataset in CSV format, load it in the DataFrame, and use SQL to run some straightforward profiling queries.
Getting ready
This recipe uses Azure Databricks. If you are using a trial Azure subscription, you will need to upgrade it to a Pay-As-You-Go subscription. Azure Databricks requires eight cores of computing resources. The trial Azure subscription has only four computing resource cores. If you are using an Enterprise or MSDN Azure subscription, it should contain enough resources for Azure Databricks.
Start your Databricks cluster before beginning the recipe. The cluster needs to be started for the code to run.
How to do it…
Let's start our first recipe:
- In the web browser...