繁体   English   中英

如何将Spark Dataframe添加到另一个数据框的底部?

[英]How to add a Spark Dataframe to the bottom of another dataframe?

我可以使用withcolumn将新列添加到Dataframe。 但是在scala中如何向DataFrame添加新行?

我正在尝试将数据框添加到另一个的底部。 因此,如何在scala中添加行或如何将DataFrame添加到另一个的底部将有所帮助。 谢谢

如果它们具有相同的模式,只需使用union for spark 2+:

val dfUnion = df1.union(df2)

或者unionAll for spark 1+:

val dfUnion = df1.unionAll(df2)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM