Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Last active July 12, 2023 19:06
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 nfarah86/3bd82d9acd7979ff3681ee79e7b69f32 to your computer and use it in GitHub Desktop.
Save nfarah86/3bd82d9acd7979ff3681ee79e7b69f32 to your computer and use it in GitHub Desktop.
spark.sql("select marketplace, product_id, count(*),
avg(star_rating) from <TABLE> where product_category = 'Books'
group by 1,2 having avg(star_rating) >= 4 order by 3 desc,4 desc").show(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment