Skip to content

Implement native function of levenshtein(80) #1571

@guixiaowen

Description

@guixiaowen

Description

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

To Native function

f::string::levenshtein

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions