You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/06/24 05:11:25 UTC
[GitHub] [incubator-doris] wutiangan commented on a change in pull request #3806: Remove order by for subquery in set opertion clause
wutiangan commented on a change in pull request #3806:
URL: https://github.com/apache/incubator-doris/pull/3806#discussion_r444647788
##########
File path: fe/src/main/java/org/apache/doris/analysis/QueryStmt.java
##########
@@ -285,27 +285,25 @@ protected void createSortInfo(Analyzer analyzer) throws AnalysisException {
}
sortInfo = new SortInfo(orderingExprs, isAscOrder, nullsFirstParams);
- // order by w/o limit and offset in inline views, union operands and insert statements
+ // order by w/o limit and offset in inline views, set operands and insert statements
// are ignored.
- // TODO chenhao, open this when we don't limit rows subquery returns by SortNode.
- /*if (!hasLimit() && !hasOffset() && !analyzer.isRootAnalyzer()) {
- * evaluateOrderBy = false;
- * // Return a warning that the order by was ignored.
- * StringBuilder strBuilder = new StringBuilder();
- * strBuilder.append("Ignoring ORDER BY clause without LIMIT or OFFSET: ");
- * strBuilder.append("ORDER BY ");
- * strBuilder.append(orderByElements.get(0).toSql());
- * for (int i = 1; i < orderByElements.size(); ++i) {
- * strBuilder.append(", ").append(orderByElements.get(i).toSql());
- * }
- * strBuilder.append(".\nAn ORDER BY appearing in a view, subquery, union operand, ");
- * strBuilder.append("or an insert/ctas statement has no effect on the query result ");
- * strBuilder.append("unless a LIMIT and/or OFFSET is used in conjunction ");
- * strBuilder.append("with the ORDER BY.");
- * } else {
- */
- evaluateOrderBy = true;
- //}
+ if (!hasLimit() && !hasOffset() && !analyzer.isRootAnalyzer()) {
+ evaluateOrderBy = false;
+ // Return a warning that the order by was ignored.
+ StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("Ignoring ORDER BY clause without LIMIT or OFFSET: ");
+ strBuilder.append("ORDER BY ");
+ strBuilder.append(orderByElements.get(0).toSql());
+ for (int i = 1; i < orderByElements.size(); ++i) {
+ strBuilder.append(", ").append(orderByElements.get(i).toSql());
+ }
+ strBuilder.append(".\nAn ORDER BY appearing in a view, subquery, union operand, ");
Review comment:
```suggestion
strBuilder.append(".\nAn ORDER BY appearing in a view, subquery, set operand, ");
```
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org