Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I combine(concatenate) two data frames with the same column name in java

Can I append a dataframe to the right of other dataframe having same column names

like image 296
Seena V P Avatar asked Nov 03 '16 08:11

Seena V P


1 Answers

You can join two dataframes like this.

df1.join(df2, df1.col("column").equalTo(df2("column")));

If you are looking for Union, then you can do something like this.

df1.unionAll(df2);  // spark 1.6

Spark 2.0, unionAll was renamed to union

like image 124
Shankar Avatar answered Sep 19 '22 16:09

Shankar