You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/03/04 14:23:26 UTC

[incubator-doris] branch master updated: [Enhance] Remove order by from insert into select (#5419)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c34013  [Enhance] Remove order by from insert into select (#5419)
8c34013 is described below

commit 8c34013cf6d0cba764e542f6b52caa92b1fb42f9
Author: Zhengguo Yang <ya...@gmail.com>
AuthorDate: Thu Mar 4 22:23:16 2021 +0800

    [Enhance] Remove order by from insert into select (#5419)
    
    remove unnecessary order by of insert into select stmt
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java
index c457892..a53b2e3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java
@@ -301,7 +301,7 @@ public abstract class QueryStmt extends StatementBase {
         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)) {
             evaluateOrderBy = false;
             // Return a warning that the order by was ignored.
             StringBuilder strBuilder = new StringBuilder();


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