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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to