MaxGekk commented on code in PR #36221:
URL: https://github.com/apache/spark/pull/36221#discussion_r851722425
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -405,4 +405,47 @@ class QueryParsingErrorsSuite extends QueryTest with
SharedSparkSession {
|-----------------------------^^^
|""".stripMargin)
}
+
+ test("PARSE_EMPTY_STATEMENT: ") {
+ validateParsingError(
+ sqlText = "",
+ errorClass = "PARSE_EMPTY_STATEMENT",
+ sqlState = "42000",
+ message =
+ """
+ |Syntax error, unexpected empty statement(line 1, pos 0)
+ |
+ |== SQL ==
+ |
+ |^^^
+ |""".stripMargin)
+
+ validateParsingError(
+ sqlText = " ",
+ errorClass = "PARSE_EMPTY_STATEMENT",
+ sqlState = "42000",
+ message =
+ """
+ |Syntax error, unexpected empty statement(line 1, pos 3)
+ |
+ |== SQL ==
+ | """.stripMargin +
+ """
Review Comment:
Can't you from a single string?
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -405,4 +405,47 @@ class QueryParsingErrorsSuite extends QueryTest with
SharedSparkSession {
|-----------------------------^^^
|""".stripMargin)
}
+
+ test("PARSE_EMPTY_STATEMENT: ") {
Review Comment:
nit:
```suggestion
test("PARSE_EMPTY_STATEMENT: empty input") {
```
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -405,4 +405,47 @@ class QueryParsingErrorsSuite extends QueryTest with
SharedSparkSession {
|-----------------------------^^^
|""".stripMargin)
}
+
+ test("PARSE_EMPTY_STATEMENT: ") {
+ validateParsingError(
+ sqlText = "",
+ errorClass = "PARSE_EMPTY_STATEMENT",
+ sqlState = "42000",
+ message =
+ """
+ |Syntax error, unexpected empty statement(line 1, pos 0)
+ |
+ |== SQL ==
+ |
+ |^^^
+ |""".stripMargin)
+
+ validateParsingError(
+ sqlText = " ",
+ errorClass = "PARSE_EMPTY_STATEMENT",
+ sqlState = "42000",
+ message =
+ """
+ |Syntax error, unexpected empty statement(line 1, pos 3)
+ |
+ |== SQL ==
+ | """.stripMargin +
+ """
+ |---^^^
+ |""".stripMargin)
+
+ validateParsingError(
+ sqlText = " \n",
+ errorClass = "PARSE_EMPTY_STATEMENT",
+ sqlState = "42000",
+ message =
+ """
+ |Syntax error, unexpected empty statement(line 2, pos 0)
+ |
+ |== SQL ==
+ | """.stripMargin +
+ """
Review Comment:
The same as above - form one string, please.
--
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]