spark dstaframe 多字段统计
val aggCols = List("Pclass","Age","Fare")
.map(colName=>functions.avg(colName).as("avg_"+colName))
df.groupBy("Survived").agg(aggCols.head,aggCols.tail:_*).show()
val aggCols = List("Pclass","Age","Fare")
.map(colName=>functions.avg(colName).as("avg_"+colName))
df.groupBy("Survived").agg(aggCols.head,aggCols.tail:_*).show()