Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

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

Writer Andrew Mclaughlin

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

3

1 Answer

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

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy