如何将星火数据框添加到另一个数据框的底部? [英] How to add a Spark Dataframe to the bottom of another dataframe?

查看:137
本文介绍了如何将星火数据框添加到另一个数据框的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 withcolumn 来新列添加到数据框。但在斯卡拉我怎么能新行添加到数据帧?

I can use withcolumnto add new columns to a Dataframe. But in scala how can I add new rows to a DataFrame?

我想一个数据帧添加到另一个的底部。因此,无论怎样在斯卡拉或如何将数据帧添加到另一个人会帮的底部添加行。谢谢

I'm trying to add a dataframe to the bottom of another one. So either how to add rows in scala or how to add a DataFrame to the bottom of another one will help. Thanks

推荐答案

如果他们有相同的架构,使用简单的 unionAll

If they have the same schema, simple use unionAll:

val dfUnion = df1.unionAll(df2)

这篇关于如何将星火数据框添加到另一个数据框的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆