Skip to content

[AURON #1571]Implement native function of levenshtein(80) #1571#1573

Merged
richox merged 2 commits intoapache:masterfrom
guixiaowen:addLevenshtein
Nov 3, 2025
Merged

[AURON #1571]Implement native function of levenshtein(80) #1571#1573
richox merged 2 commits intoapache:masterfrom
guixiaowen:addLevenshtein

Conversation

@guixiaowen
Copy link
Contributor

@guixiaowen guixiaowen commented Nov 2, 2025

Which issue does this PR close?

Closes #1571

Rationale for this change

Convert Spark's built-in function levenshtein to execute as a native function.

Spark function name:
levenshtein

Method description:

levenshtein(str1, str2[, threshold]) - Returns the Levenshtein distance between the two given strings. If threshold is set and distance more than it, return -1.

Examples:

SELECT levenshtein('kitten', 'sitting');
3
SELECT levenshtein('kitten', 'sitting', 2);
-1

What changes are included in this PR?

Are there any user-facing changes?

The Spark built-in function levenshtein is converted to f::string::levenshtein()

How was this patch tested?

UT

@guixiaowen guixiaowen changed the title [AURON #1571]Implement native function of Levenshtein(80) #1571 [AURON #1571]Implement native function of levenshtein(80) #1571 Nov 2, 2025
@guixiaowen guixiaowen marked this pull request as draft November 2, 2025 12:00
@guixiaowen guixiaowen marked this pull request as ready for review November 2, 2025 17:28
@richox richox merged commit c7f09f5 into apache:master Nov 3, 2025
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement native function of levenshtein(80)

2 participants