Github user maropu commented on the issue: https://github.com/apache/spark/pull/18300 @viirya How about this? ``` scala> val df1 = Seq((1, "2", 3.4)).toDF("a", "b", "c") scala> val df2 = Seq((1, "3", 6.7)).toDF("a", "b", "c") scala> df1.union(df2).printSchema root |-- a: integer (nullable = false) |-- b: string (nullable = true) |-- c: double (nullable = false) scala> df1.union(df2).show +---+---+---+ | a| b| c| +---+---+---+ | 1| 2|3.4| | 1| 3|6.7| +---+---+---+ scala> val df1 = Seq((1, "2", 3.4)).toDF("a", "b", "c") scala> val df2 = Seq((6.7, 4, "5")).toDF("c", "a", "b") scala> df1.unionByName(df2).printSchema root |-- a: integer (nullable = false) |-- b: string (nullable = true) |-- c: double (nullable = false) scala> df1.unionByName(df2).show +---+---+---+ | a| b| c| +---+---+---+ | 1| 2|3.4| | 1| 3|6.7| +---+---+---+ ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org