--

Hello Sangeetha,

Map/Struct datatypes never gurantee the sequence of columns/data. In general scenario if you need to read the data in a defined sequence, you can always define the column names in sequence in select e.g. df.select("struct.id", "struct.name", "struct.age", "struct.yoe")

But, expanding it directly with struct.* will not gurantee any sequence.

Hope, this answers your query.

--

--

No responses yet