coursera spark sql max count
df.groupBy(color).max("count").show();
+-----------+----------+
|color |max(count)|
+-----------+----------+
| red| 5|
| blue| 3|
| brown| 2|
| green| 2|
+-----------+----------+
4.67
3
+-----------+----------+----------+
|color | date|max(count)|
+-----------+----------+----------+
| red|2014-05-26| 5|
| blue|2014-05-26| 3|
| brown|2014-07-31| 2|
| green|2014-08-01| 2|
+-----------+----------+----------+
Thank you!
3
0
Are there any code examples left?
New code examples in category SQL