
如何打印 spark dataframe
1个回答
展开全部
打印DataFrame里面的模式
在创建完DataFrame之后,我们一般都会查看里面数据的模式,我们可以通过printSchema函数来查看。它会打印出列的名称和类型:
students.printSchema
root
|--
id:
string (nullable =
true)
|--
studentName:
string (nullable =
true)
|--
phone:
string (nullable =
true)
|--
email:
string (nullable =
true)
如果采用的是load方式参见DataFrame的,students.printSchema的输出则如下:
root
|--
id|studentName|phone|email:
string (nullable =
true)
在创建完DataFrame之后,我们一般都会查看里面数据的模式,我们可以通过printSchema函数来查看。它会打印出列的名称和类型:
students.printSchema
root
|--
id:
string (nullable =
true)
|--
studentName:
string (nullable =
true)
|--
phone:
string (nullable =
true)
|--
email:
string (nullable =
true)
如果采用的是load方式参见DataFrame的,students.printSchema的输出则如下:
root
|--
id|studentName|phone|email:
string (nullable =
true)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询