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 2021/03/04 02:44:49 UTC

[GitHub] [incubator-doris] EmmyMiao87 commented on a change in pull request #5419: Remove order by from `insert into select`

EmmyMiao87 commented on a change in pull request #5419:
URL: https://github.com/apache/incubator-doris/pull/5419#discussion_r587007632



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java
##########
@@ -301,7 +301,7 @@ protected void createSortInfo(Analyzer analyzer) throws AnalysisException {
         sortInfo = new SortInfo(orderingExprs, isAscOrder, nullsFirstParams);
         // order by w/o limit and offset in inline views, set operands and insert statements
         // are ignored.
-        if (!hasLimit() && !hasOffset() && !analyzer.isRootAnalyzer()) {
+        if (!hasLimit() && !hasOffset() && (!analyzer.isRootAnalyzer() || fromInsert)) {

Review comment:
       May be we could just remove the order by directly. 
   Because the value of Insert is actually useless after order by.




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