Skip to content

Commit d719f64

Browse files
miland-dbMaxGekk
authored andcommitted
[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 #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 <[email protected]> Signed-off-by: Max Gekk <[email protected]> (cherry picked from commit ad13a88) Signed-off-by: Max Gekk <[email protected]>
1 parent c84d33f commit d719f64

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingE2eSuite.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class SqlScriptingE2eSuite extends QueryTest with SharedSparkSession {
5050

5151
// Tests setup
5252
override protected def sparkConf: SparkConf = {
53-
super.sparkConf.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
53+
super.sparkConf
54+
.set(SQLConf.ANSI_ENABLED.key, "true")
55+
.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
5456
}
5557

5658
// Tests

sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionSuite.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class SqlScriptingExecutionSuite extends QueryTest with SharedSparkSession {
3838

3939
// Tests setup
4040
override protected def sparkConf: SparkConf = {
41-
super.sparkConf.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
41+
super.sparkConf
42+
.set(SQLConf.ANSI_ENABLED.key, "true")
43+
.set(SQLConf.SQL_SCRIPTING_ENABLED.key, "true")
4244
}
4345

4446
// Helpers

0 commit comments

Comments
 (0)