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 2023/06/03 12:13:29 UTC

[doris] branch branch-1.2-lts updated: Revert "[Bug](function) fix equals implements not judge order by elements of function call expr (#20083)"

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

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


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 8e4e6e2afb Revert "[Bug](function) fix equals implements not judge order by elements of function call expr (#20083)"
8e4e6e2afb is described below

commit 8e4e6e2afb62e32014ce72ceefd46e4352e43db0
Author: morningman <mo...@163.com>
AuthorDate: Sat Jun 3 20:11:10 2023 +0800

    Revert "[Bug](function) fix equals implements not judge order by elements of function call expr (#20083)"
    
    This reverts commit dc981cc55e9422e003455a526e95eb86fc4507ac.
---
 .../apache/doris/analysis/FunctionCallExpr.java    | 22 ++++------------------
 .../query_p0/group_concat/test_group_concat.out    |  4 ----
 .../query_p0/group_concat/test_group_concat.groovy |  4 ----
 3 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
index 9e1cf21648..e35eec84d2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
@@ -486,14 +486,6 @@ public class FunctionCallExpr extends Expr {
             return false;
         }
         FunctionCallExpr o = (FunctionCallExpr) obj;
-        if (orderByElements.size() != o.orderByElements.size()) {
-            return false;
-        }
-        for (int i = 0; i < orderByElements.size(); i++) {
-            if (!orderByElements.get(i).equals(o.orderByElements.get(i))) {
-                return false;
-            }
-        }
         return /*opcode == o.opcode && aggOp == o.aggOp &&*/ fnName.equals(o.fnName)
                 && fnParams.isDistinct() == o.fnParams.isDistinct()
                 && fnParams.isStar() == o.fnParams.isStar();
@@ -528,18 +520,12 @@ public class FunctionCallExpr extends Expr {
                     || fnName.getFunction().equalsIgnoreCase("sm4_encrypt"))) {
                 result.add("\'***\'");
             } else if (orderByElements.size() > 0 && i == len - orderByElements.size()) {
-                sb.append("ORDER BY ");
-            }
-            sb.append(children.get(i).toSql());
-            if (orderByElements.size() > 0 && i >= len - orderByElements.size()) {
-                if (orderByElements.get(i - len + orderByElements.size()).getIsAsc()) {
-                    sb.append(" ASC");
-                } else {
-                    sb.append(" DESC");
-                }
+                result.add("ORDER BY " + children.get(i).toSql());
+            } else {
+                result.add(children.get(i).toSql());
             }
         }
-        sb.append(")");
+        sb.append(Joiner.on(", ").join(result)).append(")");
         return sb.toString();
     }
 
diff --git a/regression-test/data/query_p0/group_concat/test_group_concat.out b/regression-test/data/query_p0/group_concat/test_group_concat.out
index 0bc76e1146..0e6aab79a8 100644
--- a/regression-test/data/query_p0/group_concat/test_group_concat.out
+++ b/regression-test/data/query_p0/group_concat/test_group_concat.out
@@ -48,7 +48,3 @@ false
 -- !select_group_concat_order_by_desc3 --
 1	3, 21, 2, 11, 1
 2	23, 222, 22, 211, 21
-
--- !select_group_concat_order_by --
-1,11,2,21,21,211,22,222,23,3	3,23,222,22,211,21,21,2,11,1
-
diff --git a/regression-test/suites/query_p0/group_concat/test_group_concat.groovy b/regression-test/suites/query_p0/group_concat/test_group_concat.groovy
index f2d5dd3504..a5781f39e1 100644
--- a/regression-test/suites/query_p0/group_concat/test_group_concat.groovy
+++ b/regression-test/suites/query_p0/group_concat/test_group_concat.groovy
@@ -62,8 +62,4 @@ suite("test_group_concat") {
     qt_select_group_concat_order_by_desc3 """
                 SELECT b1, group_concat(cast(abs(b3) as varchar) order by abs(b2) desc, b3 desc) FROM table_group_concat  group by b1 order by b1
               """
-    qt_select_group_concat_order_by """
-                select group_concat(b3,',' order by b3 asc),group_concat(b3,',' order by b3 desc) from table_group_concat;
-    """
-
 }


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