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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new d70751a808d [fix](planner)remove constant expr in window function's 
partition and order exprs (#36185)
d70751a808d is described below

commit d70751a808dbc86d81adec6307c4d1751b302f29
Author: starocean999 <40539150+starocean...@users.noreply.github.com>
AuthorDate: Thu Jun 13 15:05:21 2024 +0800

    [fix](planner)remove constant expr in window function's partition and order 
exprs (#36185)
    
    pick from master https://github.com/apache/doris/pull/36184
---
 .../java/org/apache/doris/analysis/AnalyticExpr.java   | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticExpr.java
index 5906e55965e..390d0a349fb 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticExpr.java
@@ -475,22 +475,8 @@ public class AnalyticExpr extends Expr {
     public void analyzeImpl(Analyzer analyzer) throws AnalysisException {
         fnCall.analyze(analyzer);
         type = getFnCall().getType();
-
-        for (Expr e : partitionExprs) {
-            if (e.isLiteral()) {
-                throw new AnalysisException(
-                    "Expressions in the PARTITION BY clause must not be 
constant: "
-                    + e.toSql() + " (in " + toSql() + ")");
-            }
-        }
-
-        for (OrderByElement e : orderByElements) {
-            if (e.getExpr().isLiteral()) {
-                throw new AnalysisException(
-                    "Expressions in the ORDER BY clause must not be constant: "
-                            + e.getExpr().toSql() + " (in " + toSql() + ")");
-            }
-        }
+        partitionExprs.removeIf(expr -> expr.isConstant());
+        orderByElements.removeIf(expr -> expr.getExpr().isConstant());
 
         if (getFnCall().getParams().isDistinct()) {
             throw new AnalysisException(


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

Reply via email to