SaurabhChawla100 commented on pull request #32972:
URL: https://github.com/apache/spark/pull/32972#issuecomment-864455597
> I think it works in current master, no?
>
> ```
> scala> val df1 = Seq((1, Struct1(1, 2))).toDF("a", "b")
> df1: org.apache.spark.sql.DataFrame = [a: int, b: struct<c1: int, c2: int>]
>
> scala> val df2 = Seq((1, Struct2(1, 2))).toDF("a", "b")
> df2: org.apache.spark.sql.DataFrame = [a: int, b: struct<c2: int, c1: int>]
>
> scala> val unionDF = df1.unionByName(df2, true)
> unionDF: org.apache.spark.sql.Dataset[org.apache.spark.sql.Row] = [a: int,
b: struct<c1: int, c2: int>]
>
> scala> unionDF.show
> +---+------+
> | a| b|
> +---+------+
> | 1|{1, 2}|
> | 1|{2, 1}|
> +---+------+
> ```
yes this is ` val unionDF = df1.unionByName(df2, true)` working in the
current master but this is giving exception `val unionDF =
df1.unionByName(df2)` , So the change is done to make this scenario working.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]