dongjoon-hyun commented on code in PR #60400:
URL: https://github.com/apache/spark/pull/60400#discussion_r4556238531
##########
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:
Thank you for the review and approval, @viirya. Since the scalar subquery
case takes the same `!arg.foldable` branch as `rand()`, I'd like to keep the
test minimal. I verified it locally: `CALL cat.ns.sum(CAST((SELECT max(id) FROM
range(10)) AS INT), 1)` fails with `NON_FOLDABLE_ARGUMENT` for `in1`.
--
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]