Spark中DataFrame的schema
1.Schema是什么
DataFrame中提供了详细的数据结构信息,从而使得SparkSQL可以清楚地知道该数据集中包含哪些列,每列的名称和类型各是什么,
DataFrame中的数据结构信息,即为schema。
2.输出schema
还是用官网中的people.json的文件,输出schema,看看schema到底长什么样子。people.json文件的show()在上一篇文章中已经写到
scala> personDF.printSchema
root
|-- id: integer (nullable = false)
|-- name: string (nullable = true)
|-- age: integer (nullable = false)