How to select all columns in spark sql query in aggregation function

Viewed 5358

Hi I am new to spark sql.

I have a query like this.

val highvalueresult = averageDF.select($"tagShortID", $"Timestamp", $"ListenerShortID", $"rootOrgID", $"subOrgID", $"RSSI_Weight_avg").groupBy("tagShortID", "Timestamp").agg(max($"RSSI_Weight_avg").alias("maxAvgValue"))

This prints only 3 columns.

tagShortID,Timestamp,maxAvgValue

But I want to display all the column along with this column.Any help or suggestion would be appreciated.

2 Answers
Related