You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/26 17:51:50 UTC

[GitHub] [spark] samsetegne commented on a change in pull request #27567: [SPARK-30822][SQL] Remove semicolon at the end of a sql query

samsetegne commented on a change in pull request #27567: [SPARK-30822][SQL] Remove semicolon at the end of a sql query
URL: https://github.com/apache/spark/pull/27567#discussion_r384660935
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
 ##########
 @@ -45,7 +45,10 @@ class SparkSqlParser(conf: SQLConf) extends AbstractSqlParser(conf) {
   private val substitutor = new VariableSubstitution(conf)
 
   protected override def parse[T](command: String)(toResult: SqlBaseParser => T): T = {
-    super.parse(substitutor.substitute(command))(toResult)
+    val trimmed_command = if (command.trim.endsWith(";")) {
 
 Review comment:
   Yeah that would actually be much cleaner. What do you think about adding the quantifier as `(';')*?` to allow for any number of semicolons, i.e.
   ```scala
   sql("select name from people;;;;;;")
   ```
   It goes beyond handling the accidental additional semicolon but I don't see why any number of semicolons at the end would make a query ambiguous.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org