diff options
-rw-r--r-- | docs/sql-programming-guide.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/sql-programming-guide.md b/docs/sql-programming-guide.md index 940c1d7704..efdf873c34 100644 --- a/docs/sql-programming-guide.md +++ b/docs/sql-programming-guide.md @@ -2221,7 +2221,7 @@ import pyspark.sql.functions as func # In 1.3.x, in order for the grouping column "department" to show up, # it must be included explicitly as part of the agg function call. -df.groupBy("department").agg("department"), func.max("age"), func.sum("expense")) +df.groupBy("department").agg(df["department"], func.max("age"), func.sum("expense")) # In 1.4+, grouping column "department" is included automatically. df.groupBy("department").agg(func.max("age"), func.sum("expense")) |