Sanket9394
Sanket9394

Reputation: 2091

Spark StructType VS Case Class

I understand that Case Class are minimal regular classes and StructType is a spark Datatype which is a collection of StructFields.

But we can use both Case Class and StructType to create Dataframes and other use cases in a similar way.

Wanted to understand

Upvotes: 2

Views: 1474

Answers (1)

Ged
Ged

Reputation: 18108

There is no real aspect that defines which one is better now.

Case had a limit of 22 fields, but that is no longer the case.

It strikes me that case is easier to work with than defining the Structs. Answer irt data frames.

Upvotes: 0

Related Questions