cloud-fan commented on a change in pull request #26629: [SPARK-29768][SQL]
Column pruning through nondeterministic expressions
URL: https://github.com/apache/spark/pull/26629#discussion_r350320040
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/PrunedScanSuite.scala
##########
@@ -148,5 +148,27 @@ class PrunedScanSuite extends DataSourceTest with
SharedSparkSession {
}
}
}
+
+ testNonDeterministicPruning("SELECT a, rand() FROM oneToTenPruned WHERE a >
5", "a")
+
+ testNonDeterministicPruning("SELECT a FROM oneToTenPruned WHERE rand() > 5",
"a")
+
+ testNonDeterministicPruning("SELECT a, rand() FROM oneToTenPruned WHERE
rand() > 5", "a")
+
+ testNonDeterministicPruning("SELECT a, rand() FROM oneToTenPruned WHERE b >
5", "a", "b")
+
+ def testNonDeterministicPruning(sqlString: String, expectedColumns:
String*): Unit = {
Review comment:
why can't we reuse `testPruning`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]