viirya commented on code in PR #60400:
URL: https://github.com/apache/spark/pull/60400#discussion_r4555626903
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/ProcedureSuite.scala:
##########
@@ -98,6 +98,19 @@ class ProcedureSuite extends SharedSparkSession with
BeforeAndAfter {
checkAnswer(sql("CALL cat.ns.sum((1 + 1) * 2, in2 => (2 + 1) / 3)"),
Row(5) :: Nil)
}
+ test("SPARK-61557: non-foldable arguments") {
+ catalog.createProcedure(Identifier.of(Array("ns"), "sum"), UnboundSum)
+ checkError(
+ exception = intercept[AnalysisException] {
+ sql("CALL cat.ns.sum(1, CAST(rand() * 10 AS INT))")
Review Comment:
nit (optional): the code comment also names the scalar-subquery case, which
is probably what users hit more often than `rand()`. It takes the same branch,
so feel free to skip, but one more statement would pin it:
```sql
CALL cat.ns.sum(1, (SELECT CAST(max(id) AS INT) FROM range(10)))
```
--
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]