mrhhsg commented on code in PR #68311:
URL: https://github.com/apache/doris/pull/68311#discussion_r4060961639
##########
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:
已在 38b7a4641840b521c00d48480d499493cd9f47a5 修复。
`evaluateConstant` 现在在翻译表达式、发送 RPC 之前,复用普通折叠的递归 `anyMatch(shouldSkipFold)`
检查。被排除的表达式保持未求值,由 ngram 参数校验明确拒绝;没有另建排除表,也没有把校验退回 batch 执行阶段。安全的 `crc32`
常量仍可正常求值。
补充验证:
- RPC 边界单测覆盖直接/嵌套 `Sleep` 和 `NonNullable`,断言零 RPC;同一可用 backend fixture 下,安全
`crc32` 对照确实发送 RPC 并得到 literal。两种 folding 设置均覆盖。这两个 no-RPC 用例在旧代码上失败,修复后通过。
- SQL 回归增加 SELECT、EXPLAIN、WHERE false 和 NULL text 下的 `sleep(0)` 拒绝用例,两种
folding 设置均覆盖。
- 17 个 FE 单测、2 套回归、ASAN FE/BE 构建、FE Checkstyle 和 diff 检查通过。
- 禁用 SQL cache 的有限手工测试中,`sleep(1)`/`sleep(8)` gram 现在约 14–15 ms
即被拒绝,拒绝后未观察到睡眠中的 BE light-pool worker;安全 `crc32` 对照正常。
本次保留的是执行准入限制,并未将 FE 的五秒等待上限描述为 BE 取消保证。
--
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]