scala - Creating nested columns in spark columns with multiple rows -
i trying create nested column in spark dataframe -
a | b | [1,2, null] | [3, null, null] | [5,6,7]
the printschema dataframe follows -
|--a: string (nullable = true) |--b: struct (nullable = true) | |--x: long (nullable = true) | |--y: long (nullable = true) | |--z: long (nullable = true)
i want dataframe nested -
a | b | [[1,2,null],[3,null,null],[5,6,7]]
and printschema should give same result before. i've tried take first row array of fields , concatenate remaining rows not working. can suggest how can desired results ? in advance.
Comments
Post a Comment