22 fields limit in Scala 2.11 + Play Framework 2.3 Case classes and functions

后端 未结 8 1560
盖世英雄少女心
盖世英雄少女心 2020-12-08 03:05

Scala 2.11 is out and the 22 fields limit for case classes seems to be fixed (Scala Issue, Release Notes).

This has been an issue for me for a while because I use ca

8条回答
  •  执笔经年
    2020-12-08 03:22

    cases where case classes might not work; one of these cases is that the case classes cannot take more than 22 fields. Another case can be that you do not know about schema beforehand. In this approach, the data is loaded as an RDD of the row objects. Schema is created separately using the StructType and StructField objects, which represent a table and a field respectively. Schema is applied to the row RDD to create DataFrame in Spark.

提交回复
热议问题