rlgarris
Databricks Employee
Databricks Employee

Hi Francis,

Thanks for reaching out.

I just tried this in version 2.0 of Databricks and it appeared to work as expected.

Are you using version 2.0 and Spark 1.4?

If so I would suggest using this alternate syntax:

from pyspark.sql import functions as F

aggs = df.groupBy("cut").agg(df.cut, F.min("carat"), F.max("carat"), F.avg("carat"))

Let me know if that works for you.