uros-b commented on code in PR #56732:
URL: https://github.com/apache/spark/pull/56732#discussion_r3466549519
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -1697,6 +1697,15 @@ class SQLQuerySuite extends SharedSparkSession with
AdaptiveSparkPlanHelper
}
assert(e.message.contains("Unsupported data source type for direct query
on files: " +
"org.apache.spark.sql.execution.datasources.jdbc"))
+
+ // Test for empty and whitespace-only paths
+ Seq("", " ", "\t", "\n", "\t\n", " \t ").foreach { location =>
+ val e = intercept[AnalysisException] {
+ sql(s"select id from json.`$location`")
+ }
+ assert(e.message.contains("The location name cannot be empty string"))
Review Comment:
The new test uses `assert(e.message.contains(...))` instead of the
structured `checkError(condition = "INVALID_EMPTY_LOCATION", parameters =
Map("location" -> location))` form used by the sibling tests.
`contains` is brittle and can false-pass; switching to `checkError` would
match sibling convention and validate the exact condition code + params. Please
update accordingly.
--
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]