beliefer commented on code in PR #44460:
URL: https://github.com/apache/spark/pull/44460#discussion_r1435908665


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala:
##########
@@ -191,15 +191,21 @@ class FilterPushdownSuite extends PlanTest {
     comparePlans(optimized, originalQuery)
   }
 
-  test("nondeterministic: can't push down filter through aggregate with 
nondeterministic field") {
+  test("nondeterministic: push down part of filter through aggregate" +
+    " with nondeterministic field") {
     val originalQuery = testRelation
       .groupBy($"a")($"a", Rand(10).as("rand"))
-      .where($"a" > 5)
+      .where($"a" > 5 && $"rand" > 5)
       .analyze
 
     val optimized = Optimize.execute(originalQuery)
+    val correctAnswer = testRelation
+      .where($"a" > 5)
+      .groupBy($"a")($"a", Rand(10).as("rand"))

Review Comment:
   It's not worth if just push down `Rand`.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to