I ran this code below, and it return a single value for salary. However, I was hoping it would also return other columns associated with the max value, so I know which categories contain the maximum value over the dataset.
df.groupBy().max('Salary').show()
I tried df.select('Company','Employee','Salary').groupBy().max('Salary').show()
, but the result does not output Company and Employee.