github-actions[bot] commented on code in PR #68579:
URL: https://github.com/apache/doris/pull/68579#discussion_r4221553267


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceFunction.java:
##########
@@ -34,17 +35,43 @@ public interface SequenceFunction extends FunctionTrait {
     default void checkLegalityBeforeTypeCoercion() {
         String functionName = getName();
         Expression firstArg = getArgument(0);
-        if (!(firstArg instanceof StringLikeLiteral)) {

Review Comment:
   [P2] Reject a typed NULL sequence pattern after constant folding. 
`sequence_count(CAST(NULL AS STRING), dt, k = 1)` passes this new constant 
gate; the rewrite turns its pattern into `NullLiteral`, which 
`checkLiteralPattern` skips. BE's nullable aggregate wrapper then skips every 
row, so `sequence_count` returns 0 instead of rejecting the invalid pattern, 
while bare `NULL` is rejected here. The same gate serves `sequence_match`. 
Reject folded NULL explicitly and add negative cases for both functions.



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