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

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


The following commit(s) were added to refs/heads/master by this push:
     new 419f433d21 [fix](Nereids) topn arg check is not compatible with legacy 
planner (#16105)
419f433d21 is described below

commit 419f433d214c2cb6dfe614cf82715b4aa8a8b060
Author: morrySnow <[email protected]>
AuthorDate: Fri Jan 20 15:08:10 2023 +0800

    [fix](Nereids) topn arg check is not compatible with legacy planner (#16105)
---
 .../apache/doris/nereids/trees/expressions/functions/agg/TopN.java    | 4 ++--
 fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
index 63e71cd108..5c1bf625a9 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
@@ -77,12 +77,12 @@ public class TopN extends AggregateFunction
 
     @Override
     public void checkLegalityBeforeTypeCoercion() {
-        if (!getArgument(1).isConstant() || 
!getArgumentType(1).isIntegerType()) {
+        if (!getArgument(1).isConstant() || 
!getArgumentType(1).isIntegerLikeType()) {
             throw new AnalysisException(
                     "topn requires second parameter must be a constant Integer 
Type: " + this.toSql());
         }
         if (arity() == 3) {
-            if (!getArgument(2).isConstant() || 
!getArgumentType(2).isIntegerType()) {
+            if (!getArgument(2).isConstant() || 
!getArgumentType(2).isIntegerLikeType()) {
                 throw new AnalysisException(
                         "topn requires the third parameter must be a constant 
Integer Type: " + this.toSql());
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
index c2fa66638d..44359fca4a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java
@@ -438,7 +438,7 @@ public abstract class DataType implements AbstractDataType {
     }
 
     public boolean isIntegerLikeType() {
-        return this instanceof IntegralType;
+        return this instanceof IntegralType && !(this instanceof LargeIntType);
     }
 
     public boolean isTinyIntType() {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to