yadavay-amzn commented on code in PR #55466:
URL: https://github.com/apache/spark/pull/55466#discussion_r3377028565
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/StringUtilsSuite.scala:
##########
@@ -287,5 +287,40 @@ class StringUtilsSuite extends SparkFunSuite with
SQLHelper {
|END""".stripMargin
)
)
+
+ // SPARK-54876: statement after semicolon ending with block comment should
not be dropped
+ assert(
+ splitSemiColonWithIndex(
+ "SELECT 1; SELECT 2 /* comment */",
+ enableSqlScripting = false) == Seq("SELECT 1", " SELECT 2 /* comment
*/")
+ )
+
+ // SPARK-54876: line comment followed by block comment should produce
empty result
+ assert(
+ splitSemiColonWithIndex(
+ "-- foo\n/* bar */",
+ enableSqlScripting = false) == Seq()
+ )
+
+ // SPARK-54876: line comment before block comment after semicolon
+ assert(
+ splitSemiColonWithIndex(
+ "SELECT 1; -- foo\n /* bar */",
+ enableSqlScripting = false) == Seq("SELECT 1")
+ )
+
+ // SPARK-54876: nested block comments
+ assert(
+ splitSemiColonWithIndex(
+ "SELECT 1; /* outer /* inner */ */",
+ enableSqlScripting = false) == Seq("SELECT 1")
+ )
+
+ // SPARK-54876: preceding closed block comment + line comment (no SQL
statement)
Review Comment:
Added this
--
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]