alamb commented on code in PR #9831:
URL: https://github.com/apache/arrow-datafusion/pull/9831#discussion_r1544372141


##########
datafusion-cli/src/helper.rs:
##########
@@ -292,4 +330,39 @@ mod tests {
 
         Ok(())
     }
+
+    #[test]

Review Comment:
   👍  thank you for the tests 👍 



##########
datafusion-cli/src/helper.rs:
##########
@@ -197,6 +204,37 @@ pub fn unescape_input(input: &str) -> 
datafusion::error::Result<String> {
     Ok(result)
 }
 
+/// Splits a string which consists of multiple queries.
+pub(crate) fn split_from_semicolon(sql: String) -> Vec<String> {
+    let mut commands = Vec::new();
+    let mut current_command = String::new();
+    let mut in_single_quote = false;
+    let mut in_double_quote = false;
+
+    for c in sql.chars() {

Review Comment:
   This is likely pretty brittle (likely won't handle all crazy corner cases, 
like for example when there are escaped quotes `\\'`, but I think it is better 
than what we have now. 
   
   Thanks @berkaysynnada 



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

Reply via email to