databricks / Spark-The-Definitive-Guide

Spark: The Definitive Guide's Code Repository
http://shop.oreilly.com/product/0636920034957.do
Other
2.85k stars 2.76k forks source link

Chapter 7 - A small correction to sql code in sumDistinct #64

Open shanmugavel04 opened 3 years ago

shanmugavel04 commented 3 years ago

Please find the below correction in book under sumDistinct section In the book: --in SQL select sum(Quantity) from dfTable -- 29310 This query will result in 5176450 rows.
correct one: --in SQL select sum(distinct(Quantity)) from dfTable -- 29310 This query will result in 29310 rows.

could you please modify the source accordingly ?