RE: Rename Several Aggregated Columns

2016-03-22 Thread Andres.Fernandez
: Re: Rename Several Aggregated Columns One way is to rename the columns using the toDF For eg: val df = Seq((1, 2),(1,4),(2,3) ).toDF("a","b") df.printSchema() val renamedf = df.groupBy('a).agg(sum('b)).toDF("mycola", "mycolb") renamedf.printSchema(

Re: Rename Several Aggregated Columns

2016-03-19 Thread Sunitha Kambhampati
One way is to rename the columns using the toDF For eg: val df = Seq((1, 2),(1,4),(2,3) ).toDF("a","b") df.printSchema() val renamedf = df.groupBy('a).agg(sum('b)).toDF("mycola", "mycolb") renamedf.printSchema() Best regards, Sunitha > On Mar 18, 2016, at 9:10 AM,