Created
January 12, 2021 19:09
-
-
Save bh1995/3408cf053cd30f01765bfb512071d30d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SQL query for getting listings per city and ordering them | |
listing_sql = """SELECT city, count(id) as total_listing, count(DISTINCT neighbourhood_cleansed) as total_neighbourhood | |
FROM listings_df2 | |
GROUP BY city | |
ORDER BY total_listing DESC""" | |
listing_total = spark.sql(listing_sql).cache(); | |
# Show first 30 | |
listing_total.show(30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment