srielau commented on code in PR #58530:
URL: https://github.com/apache/spark/pull/58530#discussion_r3961122528


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/SqlStatementSplitter.scala:
##########
@@ -253,17 +312,13 @@ object SqlStatementSplitter {
               stopInner = true
             } else if (token.getType == SqlBaseLexer.SEMICOLON) {
               if (bufferHasContent) {
-                val stmt = buffer.toString.trim
-                if (stmt.nonEmpty) {
-                  completeStatements += SqlStatement(stmt, token.getText)
-                }
+                positionedStatement(token.getText).foreach(completeStatements 
+= _)

Review Comment:
   Fixed in 94894f6941e. parse_sql now enables an error-recovering boundary 
pass for BEGIN-led candidates, verifies that the recovered outer END is a real 
token rather than a synthetic recovery token, and emits the balanced script as 
one failed statement. Generic splitting keeps its existing fallback behavior 
for unsupported extensions. I added coverage for terminated and unterminated 
malformed blocks, a following valid statement, the parse_sql JSON shape, and 
regenerated the SQL golden outputs.



-- 
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]

Reply via email to