dataframe中head() first() take() collect() show() tail() limit()的关系
first() = head(1) head() 底层调用 take()
show() 底层调用的take() 多了一层类型转换 将值转化为字符串 多了truncate参数,截取字符串功能
take() 调用 collect() + limit()
collect()触发runjob()执行任务
tail() 返回dataframe最后一行,可能会OOM
方法及源码截图和部分函数描述
collect()
limit()
take()
Take the first num elements of the RDD.
show() 底层调用的take() 多了一层类型转换 将值转化为字符串 多了truncate参数,截取字符串功能
tail()
head()
first()
/**
* Return the first element in this RDD.
*/