leo65535 commented on a change in pull request #930:
URL:
https://github.com/apache/incubator-seatunnel/pull/930#discussion_r778583331
##########
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:
hi, we already handle the logic in `SqlStatementSplitter#splitContent`,
it will return the 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]