viirya commented on a change in pull request #30504:
URL: https://github.com/apache/spark/pull/30504#discussion_r533705380
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ConstantFoldingSuite.scala
##########
@@ -263,4 +263,19 @@ class ConstantFoldingSuite extends PlanTest {
comparePlans(optimized, correctAnswer)
}
+
+ test("Constant folding test with sideaffects") {
+ val originalQuery =
+ testRelation
+ .select("size(array(assert_true(false)))")
+
+ val optimized = Optimize.execute(originalQuery.analyze)
+
+ val correctAnswer =
+ testRelation
+ .select("size(array(assert_true(false)))")
+ .analyze
+
+ comparePlans(optimized, correctAnswer)
Review comment:
Thanks for adding test.
----------------------------------------------------------------
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]