val aggCols = List("Pclass","Age","Fare")
.map(colName=>functions.avg(colName).as("avg_"+colName))
df.groupBy("Survived").agg(aggCols.head,aggCols.tail:_*).show()
2023-10-08 22:11:28
val aggCols = List("Pclass","Age","Fare")
.map(colName=>functions.avg(colName).as("avg_"+colName))
df.groupBy("Survived").agg(aggCols.head,aggCols.tail:_*).show()