beliefer commented on code in PR #41553:
URL: https://github.com/apache/spark/pull/41553#discussion_r1226650973
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DeltaBasedDeleteFromTableSuite.scala:
##########
@@ -27,6 +27,30 @@ class DeltaBasedDeleteFromTableSuite extends
DeleteFromTableSuiteBase {
props
}
+ test("delete with nondeterministic conditions") {
+ createAndInitTable("pk INT NOT NULL, id INT, dep STRING",
+ """{ "pk": 1, "id": 1, "dep": "hr" }
+ |{ "pk": 2, "id": 2, "dep": "software" }
+ |{ "pk": 3, "id": 3, "dep": "hr" }
+ |""".stripMargin)
+
+ checkError(
+ exception = intercept[AnalysisException](
+ sql(s"DELETE FROM $tableNameAsString WHERE id <= 1 AND rand() > 0.5")),
+ errorClass = "INVALID_NON_DETERMINISTIC_EXPRESSIONS",
+ parameters = Map(
+ "sqlExprs" -> "\"((id <= 1) AND (rand() > 0.5))\"",
+ "operator" ->
+ """
+ |WriteDelta RelationV2[pk#2810, id#2811, dep#2812]
cat.ns1.test_table cat.ns1.test_table
Review Comment:
@MaxGekk The `exprId` for expression is not stable. Do you have any
suggestions?
--
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]