viirya commented on code in PR #50518: URL: https://github.com/apache/spark/pull/50518#discussion_r2031724184
########## sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/parsers.scala: ########## @@ -158,24 +157,19 @@ case object ParseErrorListener extends BaseErrorListener { charPositionInLine: Int, msg: String, e: RecognitionException): Unit = { - val (start, stop) = offendingSymbol match { + val start = offendingSymbol match { case token: CommonToken => - val start = Origin(Some(line), Some(token.getCharPositionInLine)) - val length = token.getStopIndex - token.getStartIndex + 1 - val stop = Origin(Some(line), Some(token.getCharPositionInLine + length)) - (start, stop) + Origin(Some(line), Some(token.getCharPositionInLine)) case _ => - val start = Origin(Some(line), Some(charPositionInLine)) - (start, start) + Origin(Some(line), Some(charPositionInLine)) } e match { case sre: SparkRecognitionException if sre.errorClass.isDefined => - throw new ParseException(None, start, stop, sre.errorClass.get, sre.messageParameters) + throw new ParseException(None, start, sre.errorClass.get, sre.messageParameters) case _ => throw new ParseException( command = None, start = start, - stop = stop, Review Comment: Oh, `ParseException` doesn't use `stop` actually. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org