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-590096673
 
 
   > Ah, I see. Do most JDBC clients ignore a semicolon in the end? Could you 
check the other JDBC client behaivours, too?
   
   The acceptance of the terminating semicolon happens at the database layer so 
most (if not all) JDBC clients ship the query to the database with the 
semicolon included. Even if the client does not support multiple statements, 
the database does and so I imagine that a statement that looks like 
`<statement>;` would just be split by the dbms into `<statement>` and an empty 
string that's ignored.
   
   Here's an example in the Hive CLI source code where a statement is split at 
the semicolon and each statement has a terminating semicolon appended to it. 
There's also some logic to prevent confusing `";"` (quoted text containing a 
semicolon) for a statement terminating semicolon.
   
https://github.com/apache/hive/blob/master/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java#L405
   
   Terminating semicolons are also commonly accepted by NoSQL dbms', i.e. 
Cassandra which identifies a CQL statement as: `cql_statement ::=  statement [ 
';' ]`
   https://cassandra.apache.org/doc/latest/cql/definitions.html#statements

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

Reply via email to