You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@auron.apache.org by "lyne7-sc (via GitHub)" <gi...@apache.org> on 2026/05/19 07:10:55 UTC
[I] Support Levenshtein func with threshold parameter for Spark 4+ [auron]
lyne7-sc opened a new issue, #2279:
URL: https://github.com/apache/auron/issues/2279
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->
The native `Levenshtein` function currently delegates to DataFusion's built-in `levenshtein`, which only supports 2 arguments (left, right). Starting from Spark 4, the `Levenshtein` expression supports an optional third `threshold` parameter, when the edit distance exceeds the threshold, it returns `-1` instead of the actual distance.
The native implementation falls back to DataFusion's `levenshtein` which ignores the threshold parameter, causing result mismatches with Spark on 3-argument calls.
**To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
Because the native implementation lacked threshold support, the `"string Levenshtein distance"` test was excluded in Spark 4.0/4.1 test settings.
**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->
- `levenshtein('kitten', 'sitting')` → `3`
- `levenshtein('kitten', 'sitting', 2)` → `-1` (distance 3 > threshold 2)
- `levenshtein('kitten', 'sitting', 5)` → `3` (distance 3 ≤ threshold 5)
**Screenshots**
<!--
If applicable, add screenshots to help explain your problem.
-->
**Additional context**
<!--
Add any other context about the problem here.
-->
--
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: commits-unsubscribe@auron.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org