morrySnow commented on code in PR #45065:
URL: https://github.com/apache/doris/pull/45065#discussion_r1875827867


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/WindowFunctionChecker.java:
##########
@@ -315,6 +316,14 @@ public Lead visitLead(Lead lead, Void ctx) {
      */
     @Override
     public FirstOrLastValue visitFirstValue(FirstValue firstValue, Void ctx) {
+        if (2 == firstValue.arity()) {
+            if (!firstValue.child(1).isConstant()) {
+                throw new AnalysisException("The second parameter of 
first_value must be constant");
+            }

Review Comment:
   maybe we should add this check in 
`org.apache.doris.nereids.trees.expressions.functions.window.FirstOrLastValue`.
   let impl `checkLegalityBeforeTypeCoercion`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to