github-actions[bot] commented on code in PR #60412:
URL: https://github.com/apache/doris/pull/60412#discussion_r3123909550
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java:
##########
@@ -1123,6 +1123,74 @@ public static Expression soundex(StringLikeLiteral
first) {
return castStringLikeLiteral(first, result);
}
+ /**
+ * Executable arithmetic functions levenshtein
+ */
+ @ExecFunction(name = "levenshtein")
+ public static Expression levenshtein(StringLikeLiteral first,
StringLikeLiteral second) {
Review Comment:
Because `enable_fold_constant_by_be` defaults to `false`, all-literal calls
here are evaluated by `FoldConstantRuleOnFE -> ExpressionEvaluator` on the FE
planner. Unlike `repeat()` / `space()`, this implementation has no size or cost
guard. A query can still fit under the default `max_allowed_packet` with two
multi-MiB string literals, and FE will then try to run O(m*n) DP plus several
large temporary arrays before the query ever reaches BE. Please add a cutoff
(or skip FE folding for `levenshtein`) and cover it with a constant-fold
regression test.
--
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]