Description
In current implementation, First and Last aggregates were calculating the values for entire DataFrame partition and then the same value was returned for all GroupedData in the partition.
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregates.scala
Fixed the First and Last aggregates should compute first and last value per GroupedData instead of entire DataFrame.