//定义schame的第一种方式
val schema = StructType(
Array(
StructField(“name”, StringType),
StructField(“age”, StringType),
StructField(“yundong”, StringType)
)
)
//定义schame的第二种方式
val schema = new StructType().add(“name”,StringType)
.add(“age”,StringType)
.add(“shengao”, StringType)
//注意要写new
//StructType()有括号
定义schama的两种方式
最新推荐文章于 2021-12-14 10:06:03 发布