linrrzqqq commented on code in PR #63350:
URL: https://github.com/apache/doris/pull/63350#discussion_r3263405552


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNArray.java:
##########
@@ -100,6 +101,19 @@ public void checkLegalityBeforeTypeCoercion() {
         }
     }
 
+    @Override
+    public void checkLegalityAfterRewrite() {
+        Expression topNCount = getArgument(1);
+        if (topNCount.isNullLiteral()) {
+            return;
+        }
+        if (!(topNCount instanceof Literal) || ((Literal) 
topNCount).getDouble() <= 0) {
+            throw new AnalysisException(
+                    "topn_array requires second parameter must be a constant 
positive integer: "

Review Comment:
   溢出值到这里已经够被转成 null 了



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to