what does "in SQL" mean in book
yuxh opened this issue · 1 comments
yuxh commented
there are many statements in book like this:
// in Scala
df.select("ORIGIN_COUNTRY_NAME", "DEST_COUNTRY_NAME").distinct().count()
-- in SQL
SELECT COUNT(DISTINCT(ORIGIN_COUNTRY_NAME, DEST_COUNTRY_NAME)) FROM dfTable
I understand "in Scala " means execution in spark-shell. Does "in SQL" mean short hand for spark.sql("xx")? similar question is how can I execute commands in Spark-The-Definitive-Guide/code/xx.sql file?
bllchmbrs commented
Yes, that’s what in Scala and in Sql means. You’ll have to execute them 1
by 1
…On Wed, Sep 5, 2018 at 01:34 yuxh ***@***.***> wrote:
there are many statements in book like this:
// in Scala
df.select("ORIGIN_COUNTRY_NAME", "DEST_COUNTRY_NAME").distinct().count()
-- in SQL
SELECT COUNT(DISTINCT(ORIGIN_COUNTRY_NAME, DEST_COUNTRY_NAME)) FROM dfTable
I understand "in Scala " means execution in spark-shell. Does "in SQL"
mean short hand for spark.sql("xx")? similar question is how can I execute
commands in Spark-The-Definitive-Guide/code/xx.sql file?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABkQB0KkxqmANi4v1ts7e8RVW91C5vgjks5uX4x4gaJpZM4WabcL>
.