Skip to content

Commit d5b79c0

Browse files
davidm-dbMaxGekk
authored andcommitted
[SPARK-48348][SPARK-48376][FOLLOWUP][SQL] Replace parseScript with runSqlScript in SQL Scripting Interpreter test suite
### What changes were proposed in this pull request? Previous [pull request](#47973) introduced new tests to `SqlScriptingInterpreterSuite` (among others) where accidentally `parseScript` was used instead of `runSqlScript`. While the same exception would get thrown (since it happens in the parsing phase) it violates the consistency among the tests in this suite and adds unnecessary import, so it would be nice to change it. ### Why are the changes needed? Changes are minor, they improve consistency among test suites for SQL scripting. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? This patch alters tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48016 from davidm-db/interpreter_test_suite_fix. Authored-by: David Milicevic <[email protected]> Signed-off-by: Max Gekk <[email protected]>
1 parent b5e345c commit d5b79c0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package org.apache.spark.sql.scripting
2020
import org.apache.spark.SparkException
2121
import org.apache.spark.sql.{AnalysisException, DataFrame, Dataset, QueryTest, Row}
2222
import org.apache.spark.sql.catalyst.QueryPlanningTracker
23-
import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parseScript
2423
import org.apache.spark.sql.exceptions.SqlScriptingException
2524
import org.apache.spark.sql.test.SharedSparkSession
2625

@@ -575,7 +574,7 @@ class SqlScriptingInterpreterSuite extends QueryTest with SharedSparkSession {
575574
|END""".stripMargin
576575
checkError(
577576
exception = intercept[SqlScriptingException] {
578-
parseScript(sqlScriptText)
577+
runSqlScript(sqlScriptText)
579578
},
580579
errorClass = "INVALID_LABEL_USAGE.ITERATE_IN_COMPOUND",
581580
parameters = Map("labelName" -> "LBL"))
@@ -614,7 +613,7 @@ class SqlScriptingInterpreterSuite extends QueryTest with SharedSparkSession {
614613
|END""".stripMargin
615614
checkError(
616615
exception = intercept[SqlScriptingException] {
617-
parseScript(sqlScriptText)
616+
runSqlScript(sqlScriptText)
618617
},
619618
errorClass = "INVALID_LABEL_USAGE.DOES_NOT_EXIST",
620619
parameters = Map("labelName" -> "RANDOMLBL", "statementType" -> "LEAVE"))
@@ -629,7 +628,7 @@ class SqlScriptingInterpreterSuite extends QueryTest with SharedSparkSession {
629628
|END""".stripMargin
630629
checkError(
631630
exception = intercept[SqlScriptingException] {
632-
parseScript(sqlScriptText)
631+
runSqlScript(sqlScriptText)
633632
},
634633
errorClass = "INVALID_LABEL_USAGE.DOES_NOT_EXIST",
635634
parameters = Map("labelName" -> "RANDOMLBL", "statementType" -> "ITERATE"))

0 commit comments

Comments
 (0)