Skip to content

Instantly share code, notes, and snippets.

@bh1995
Created January 12, 2021 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bh1995/1368f707cf7715f97d849fa1f2902a46 to your computer and use it in GitHub Desktop.
Save bh1995/1368f707cf7715f97d849fa1f2902a46 to your computer and use it in GitHub Desktop.
neighbourhood_property_sql = """SELECT neighbourhood_cleansed, count(DISTINCT property_type) as property_type_count
FROM listings_df2
WHERE city = "Beijing"
GROUP BY neighbourhood_cleansed
ORDER BY property_type_count DESC"""
neighbourhood_property = spark.sql(neighbourhood_property_sql).cache();
neighbourhood_property.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment