leo65535 commented on a change in pull request #930:
URL: 
https://github.com/apache/incubator-seatunnel/pull/930#discussion_r778579361



##########
File path: 
seatunnel-core/seatunnel-core-sql/src/main/java/org/apache/seatunnel/core/sql/splitter/SqlStatementSplitter.java
##########
@@ -50,31 +54,32 @@
         List<String> statements = new ArrayList<>();
         List<String> buffer = new ArrayList<>();
 
-        for (String line : content.split("\n")) {
+        for (String line : content.split(LINE_SEPARATOR)) {
             if (isEndOfStatement(line)) {
                 buffer.add(line);
-                statements.add(normalizeLine(buffer));
+                statements.addAll(normalizeLine(buffer));
                 buffer.clear();
             } else {
                 buffer.add(line);
             }
         }
         if (!buffer.isEmpty()) {
-            statements.add(normalizeLine(buffer));
+            statements.addAll(normalizeLine(buffer));
         }
         return statements;
     }
 
     /**
      * Remove comment lines.
      */
-    private static String normalizeLine(List<String> buffer) {
-        return buffer.stream()
-                .map(statementLine -> 
statementLine.replaceAll(BEGINNING_COMMENT_MASK, ""))
-                .collect(Collectors.joining("\n"));
+    private static List<String> normalizeLine(List<String> buffer) {

Review comment:
       when `--` is the prefix of the statement, the whole statement is 
comment, we shouldn't split it, please revert this.
   
   
![image](https://user-images.githubusercontent.com/95013770/148172158-f5d46317-5e83-4d65-a7a2-6d2f7b06ae7d.png)
   




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