databricks/Spark-The-Definitive-Guide

Chapter 7 - A small correction to sql code in sumDistinct

shanmugavel04 opened this issue · 0 comments

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 ?