github-actions[bot] commented on code in PR #68311:
URL: https://github.com/apache/doris/pull/68311#discussion_r4060723560
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnBE.java:
##########
@@ -174,6 +174,18 @@ public static Expression
foldByBE(ExpressionMatchingContext<Expression> context)
return root;
}
+ /** Evaluate a semantic constant whose value is required for argument
validation. */
+ public static Expression evaluateConstant(Expression expression,
ConnectContext context) {
Review Comment:
[P1] Preserve the BE-fold safety exclusions here
This direct path skips the `anyMatch(shouldSkipFold)` gate used by
`collectConst`. For example, `1 + cast(sleep(3600) as int)` is a deterministic
integral constant, so `ngram_search('abc', 'abc', 1 + cast(sleep(3600) as
int))` reaches this method during binding even under `WHERE false`. The BE fold
RPC then runs `FunctionSleep`; FE times out after five seconds without
cancelling the future, so the BE light-pool task keeps sleeping, while shorter
sleeps execute during planning and are replaced by a literal. `Sleep` is
explicitly excluded from ordinary BE folding for exactly this timeout reason,
and the same gate also protects AI/search/context-bound expressions. Please
preserve those exclusions for required evaluation (reject unsafe grams without
dispatching them, while still allowing safe cases such as `crc32`) and add a
no-RPC regression for a skipped expression.
--
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]