You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2025/02/07 21:39:36 UTC

(spark) branch branch-4.0 updated: [SPARK-48353][SQL][FOLLOWUP] Enable ANSI for SQL Scripting execution suites

This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new d719f649c170 [SPARK-48353][SQL][FOLLOWUP] Enable ANSI for SQL Scripting execution suites
d719f649c170 is described below

commit d719f649c170a64c64b9f3e4ef198f327ac89fb2
Author: Milan Dankovic <mi...@databricks.com>
AuthorDate: Fri Feb 7 22:39:07 2025 +0100

    [SPARK-48353][SQL][FOLLOWUP] Enable ANSI for SQL Scripting execution suites
    
    ### What changes were proposed in this pull request?
    Keep ANSI enabled for SQL Scripting execution suites to enable proper testing of exception handling.
    
    ### Why are the changes needed?
    13 new tests in `SqlScriptingExecutionSuite` and `SqlScriptingE2eSuite` introduced in https://github.com/apache/spark/pull/49427 will fail to execute in non-ANSI mode and the NON-ANSI daily test failed:
    ![image](https://github.com/user-attachments/assets/78a0b6fd-1b98-4b85-80e5-688e4b447cae)
    
    If ANSI is off, code that should trigger exception fails silently (zero division does not throw). We want to keep ANSI behavior so that we can test exception handling properly.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Existing tests.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #49852 from miland-db/milan-dankovic_data/exception-handlers-followup-fix-test.
    
    Authored-by: Milan Dankovic <mi...@databricks.com>
    Signed-off-by: Max Gekk <ma...@gmail.com>
    (cherry picked from commit ad13a88dad7ef2331249733b0485ba1bc2263fd3)
    Signed-off-by: Max Gekk <ma...@gmail.com>
---
 .../scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala   | 4 +++-
 .../org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala
index ef16f0485543..8cd071ad126b 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala
@@ -50,7 +50,9 @@ class SqlScriptingE2eSuite extends QueryTest with SharedSparkSession {
 
   // Tests setup
   override protected def sparkConf: SparkConf = {
-    super.sparkConf.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
+    super.sparkConf
+      .set(SQLConf.ANSI_ENABLED.key, "true")
+      .set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
   }
 
   // Tests
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala
index 964e1c2a8704..219094e8d217 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala
@@ -38,7 +38,9 @@ class SqlScriptingExecutionSuite extends QueryTest with SharedSparkSession {
 
   // Tests setup
   override protected def sparkConf: SparkConf = {
-    super.sparkConf.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
+    super.sparkConf
+      .set(SQLConf.ANSI_ENABLED.key, "true")
+      .set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
   }
 
   // Helpers


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org