Skip to content

Determine key metrics about home sales data using SparkSQL and then use Spark to create temporary views, partition the data, cache and uncache a temporary table, and verify that the table has been uncached.

Notifications You must be signed in to change notification settings

DalyaLami/Home_Sales

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Home_Sales

Determine key metrics about home sales data using SparkSQL and then use Spark to create temporary views, partition the data, cache and uncache a temporary table, and verify that the table has been uncached.

Table of Contents

Getting Started

Using Jupyter Notebook and PySpark SQL, analyze home sales data and determine key metrics by observing the data and answering the questions provided.

Prerequisites

Requirements for the software and other tools to build, test and push

Coding Instruction

District Summary

Perform the necessary calculations and then create a high-level snapshot of the district's key metrics in a DataFrame. Include the following:

  1. Rename the Home_Sales_starter_code.ipynb file as Home_Sales.ipynb.

  2. Import the necessary PySpark SQL functions for this assignment.

  3. Read the home_sales_revised.csv data in the starter code into a Spark DataFrame.

  4. Create a temporary table called home_sales.

  5. Answer the following questions using SparkSQL:

    • What is the average price for a four-bedroom house sold for each year? Round off your answer to two decimal places.

    • What is the average price of a home for each year it was built that has three bedrooms and three bathrooms? Round off your answer to two decimal places.

    • What is the average price of a home for each year that has three bedrooms, three bathrooms, two floors, and is greater than or equal to 2,000 square feet? Round off your answer to two decimal places.

    • What is the "view" rating for homes costing more than or equal to $350,000? Determine the run time for this query, and round off your answer to two decimal places.

  6. Cache your temporary table home_sales.

  7. Check if your temporary table is cached.

  8. Using the cached data, run the query that filters out the view ratings with an average price of greater than or equal to $350,000. Determine the runtime and compare it to uncached runtime.

  9. Partition by the "date_built" field on the formatted parquet home sales data.

  10. Create a temporary table for the parquet data.

  11. Run the query that filters out the view ratings with an average price of greater than or equal to $350,000. Determine the runtime and compare it to uncached runtime.

  12. Uncache the home_sales temporary table.

  13. Verify that the home_sales temporary table is uncached using PySpark.

  14. Download your Home_Sales.ipynb file and upload it into your GitHub repository.

References

Data for this dataset was generated by edX Boot Camps LLC, and is intended for educational purposes only.

About

Determine key metrics about home sales data using SparkSQL and then use Spark to create temporary views, partition the data, cache and uncache a temporary table, and verify that the table has been uncached.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published