samsetegne commented on issue #27567: [SPARK-30822][SQL] Remove semicolon at the end of a sql query URL: https://github.com/apache/spark/pull/27567#issuecomment-590051081 @maropu I think the two issues are related but very much separate at the same time. There is the question of **should spark.sql accept multiple statements separated by a semicolon?** which is the discussion posed by [[SPARK-24260](https://issues.apache.org/jira/browse/SPARK-24260)]. However, even if the spark.sql API was to never accept multiple statements, the issue presented here would still remain; **should spark.sql fail when a _single_ valid SQL statement is provided with a terminal semicolon?** As examples, here are two popular MySQL clients for two different languages that do not accept multiple SQL statements yet do not fail when a single statement is provided with a terminal semicolon: https://github.com/sidorares/node-mysql2 https://github.com/PyMySQL/PyMySQL Even when using `java.sql.DriverManager` in scala, including the semicolon still makes for a successful query. ```scala connection = DriverManager.getConnection(url, username, password) val statement = connection.createStatement() val results = statement.executeQuery("select 'Bojack' as horseman;") ```
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
