vladimirg-db commented on code in PR #48827:
URL: https://github.com/apache/spark/pull/48827#discussion_r1838199428


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionAnsiErrorsSuite.scala:
##########
@@ -403,4 +403,16 @@ class QueryExecutionAnsiErrorsSuite extends QueryTest
       parameters = Map("timeZone" -> "-100")
     )
   }
+
+  test("SPARK-50290: Add a flag to disable DataFrame context") {
+    withSQLConf(SQLConf.DATA_FRAME_QUERY_CONTEXT_ENABLED.key -> "false") {
+      val df = spark.range(0, 1).select(lit(1) / col("id"))
+      checkError(
+        exception = intercept[SparkArithmeticException](df.collect()),
+        condition = "DIVIDE_BY_ZERO",
+        parameters = Map("config" -> ansiConf),
+        context = ExpectedContext("", -1, -1)

Review Comment:
   The context is always passed to `divideByZeroError`:
   
![image](https://github.com/user-attachments/assets/7018b720-96e2-4cb7-9040-0e8b1c27aa24)



-- 
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]

Reply via email to