imay closed pull request #249: Fix UnionStmt toSql bug URL: https://github.com/apache/incubator-doris/pull/249
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/fe/src/main/java/org/apache/doris/analysis/UnionStmt.java b/fe/src/main/java/org/apache/doris/analysis/UnionStmt.java index 2014b0d4..ca140971 100644 --- a/fe/src/main/java/org/apache/doris/analysis/UnionStmt.java +++ b/fe/src/main/java/org/apache/doris/analysis/UnionStmt.java @@ -534,7 +534,7 @@ public String toSql() { StringBuilder strBuilder = new StringBuilder(); Preconditions.checkState(operands.size() > 0); strBuilder.append(operands.get(0).getQueryStmt().toSql()); - for (int i = 1; i < operands.size() - i; ++i) { + for (int i = 1; i < operands.size() - 1; ++i) { strBuilder.append( " UNION " + ((operands.get(i).getQualifier() == Qualifier.ALL) ? "ALL " : "")); if (operands.get(i).getQueryStmt() instanceof UnionStmt) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org