Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Enable levenshtein function #6389

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1189,4 +1189,16 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}
}

test("levenshtein") {
runQueryAndCompare("select levenshtein(c_comment, c_address) from customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}

testWithSpecifiedSparkVersion("levenshtein with limit", Some("3.5")) {
runQueryAndCompare("select levenshtein(c_comment, c_address, 3) from customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Translate, translate, translateUTF8);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Initcap, initcap, initcapUTF8);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Conv, conv, sparkConv);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Uuid, uuid, generateUUIDv4);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(LevenshteinDistance, levenshteinDistance, editDistanceUTF8);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Levenshtein, levenshtein, editDistanceUTF8);

REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Crc32, crc32, CRC32);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Murmur3Hash, murmur3hash, sparkMurmurHash3_32);
Expand Down
2 changes: 1 addition & 1 deletion docs/velox-backend-support-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Gluten supports 199 functions. (Drag to right to see all data types)
| lcase, lower | lower | lower | S | | | | | | | | | | | S | | | | | | | | |
| left | | | S | | | | | | | | | | | S | | | | | | | | |
| length | length | length | S | | | | | | | | | | | S | | | | | | | | |
| levenshtein | | | | | | | | | | | | | | | | | | | | | | |
| levenshtein | | levenshtein | S | | | | | | | | | | | | | | | | | | | |
| locate | strpos | | S | Mismatched | | | | | | | | | | S | | | | | | | | |
| lower | lower | lower | S | | | | | | | | | | | S | | | | | | | | |
| lpad | lpad | | S | | | | | | | | | | | S | | | | | | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ object ExpressionNames {
final val UUID = "uuid"
final val BIT_LENGTH = "bit_length"
final val OCTET_LENGTH = "octet_length"
final val LEVENSHTEIN = "levenshteinDistance"
final val LEVENSHTEIN = "levenshtein"
final val UNBASE64 = "unbase64"
final val BASE64 = "base64"

Expand Down
Loading