Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/14539#discussion_r74018815
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
---
@@ -1192,8 +1192,8 @@ class DataFrameSuite extends QueryTest with
SharedSQLContext {
}
test("SPARK-10740: handle nondeterministic expressions correctly for set
operations") {
- val df1 = (1 to 20).map(Tuple1.apply).toDF("i")
- val df2 = (1 to 10).map(Tuple1.apply).toDF("i")
+ val df1 = spark.range(1, 20).select('id.cast("int").as("i"))
+ val df2 = spark.range(1, 10).select('id.cast("int").as("i"))
--- End diff --
This syntax `(1 to 20).map(Tuple1.apply).toDF("i")` produces a
`LocalRelation`. These `LocalRelation`s are subsequently `Union`'ed. The new
optimizer rules reduces this Union into a single LocalRelation. Which fails
this test, because the new approach results in an already evaluated
`LocalRelation` (using a different seed for the RNG), instead of a `Union` with
two separate partitions.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]