Github user dongjoon-hyun commented on a diff in the pull request: https://github.com/apache/spark/pull/18300#discussion_r123051866 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala --- @@ -112,6 +112,52 @@ class DataFrameSuite extends QueryTest with SharedSQLContext { ) } + test("union by name") { + // Simple case + val df1 = Seq((1, "a", 3.0)).toDF("a", "b", "c") + val df2 = Seq((1.2, 2, "bc")).toDF("c", "a", "b") + val df3 = Seq(("def", 1.2, 3)).toDF("b", "c", "a") + val unionDf = df1.unionByName(df2.unionByName(df3)) + checkAnswer(unionDf, + Row(1, "a", 3.0) :: Row(2, "bc", 1.2) :: Row(3, "def", 1.2) :: Nil + ) --- End diff -- Hi, @maropu . To be clearer, could you add more test cases requiring type coercions here?
--- 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