You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/11/16 20:51:19 UTC
[GitHub] spark pull request #18918: [SPARK-21707][SQL]Improvement a special case for ...
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/18918#discussion_r151533419
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ---
@@ -2029,4 +2029,13 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
testData2.select(lit(7), 'a, 'b).orderBy(lit(1), lit(2), lit(3)),
Seq(Row(7, 1, 1), Row(7, 1, 2), Row(7, 2, 1), Row(7, 2, 2), Row(7, 3, 1), Row(7, 3, 2)))
}
+
+ test("SPARK-21707: nondeterministic expressions correctly for filter predicates") {
+ withTempPath { path =>
+ val p = path.getAbsolutePath
+ Seq(1 -> "a").toDF("a", "b").write.partitionBy("a").parquet(p)
+ val df = spark.read.parquet(p)
+ checkAnswer(df.filter(rand(10) <= 1.0).select($"a"), Row(1))
--- End diff --
this test can pass on current master.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org