0
votes

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

  • in what scenarios we should prefer One over the other and WHY ?
  • Are there some scenarios where we have to use one of them, and not possible to use the other?
1
See that video from the Scala World Conference: youtube.com/watch?v=zXipqCcVmQM and youtube.com/watch?v=LafWXI37mcwEmiliano Martinez

1 Answers

0
votes

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.