This can be mapped as below: dataset.map(x=>((x(0),x(1),x(2)),x) This works with Dataframe of rows but i haven't tried with dataset Thanks Deepak
On Mon, Aug 7, 2017 at 8:21 AM, Jone Zhang <joyoungzh...@gmail.com> wrote: > val schema = StructType( > Seq( > StructField("app", StringType, nullable = true), > StructField("server", StringType, nullable = true), > StructField("file", StringType, nullable = true), > StructField("...", StringType, nullable = true) > ) > ) > val row = ... > val dataset = session.createDataFrame(row, schema) > > How can i split dataset to dataset array by composite key(app, > server,file) as follow > map<app, server,file=>dataset> > > > Thanks. > > > > > -- Thanks Deepak www.bigdatabig.com www.keosha.net