Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to apply GroupBy in Schema Applied Dataset?

Here I create Struct Type(schema)and applied in Data set, And Data successfully created as structured Table format,

Dataset<Row>result=df1.select(functions.from_json(functions.col("value"),struct)
.as("data"))
.select("data.*");

But my Question is when i applied group by function for worktime column it indicate error??

Dataset<Row> df2=result.groupBy("data.worktime"); //.groupBy("worktime")

Thanks in Advance!!

Comments