cloud-fan commented on a change in pull request #34668:
URL: https://github.com/apache/spark/pull/34668#discussion_r754394988



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseDriver.scala
##########
@@ -91,6 +91,23 @@ abstract class AbstractSqlParser extends ParserInterface 
with SQLConfHelper with
   /** Get the builder (visitor) which converts a ParseTree into an AST. */
   protected def astBuilder: AstBuilder
 
+  private def checkUnclosedBracketedComment(
+      command: String, tokenStream: CommonTokenStream): Unit = {
+    tokenStream.fill()
+    for (index <- 0 to tokenStream.size() - 1) {
+      val token = tokenStream.get(index)
+      if (token.getType() == SqlBaseParser.BRACKETED_COMMENT) {
+        val text = token.getText()
+        val prefixNum = ParserUtils.appearNumber(text, 
ParserUtils.bracketedCommentPrefix)
+        val suffixNum = ParserUtils.appearNumber(text, 
ParserUtils.bracketedCommentSuffix)
+        if (prefixNum > suffixNum) {

Review comment:
       if we can't check EOF, can't we just check if the last 2 chars are `*/`?




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