hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-9556) create UDF to calculate the Levenshtein distance between two strings
Date Fri, 20 Feb 2015 01:53:11 GMT

    [ https://issues.apache.org/jira/browse/HIVE-9556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14328447#comment-14328447
] 

Alexander Pivovarov commented on HIVE-9556:
-------------------------------------------

Added levenshtein function description to the wiki https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-StringFunctions

> create UDF to calculate the Levenshtein distance between two strings
> --------------------------------------------------------------------
>
>                 Key: HIVE-9556
>                 URL: https://issues.apache.org/jira/browse/HIVE-9556
>             Project: Hive
>          Issue Type: Improvement
>          Components: UDF
>            Reporter: Alexander Pivovarov
>            Assignee: Alexander Pivovarov
>              Labels: TODOC1.2
>             Fix For: 1.2.0
>
>         Attachments: HIVE-9556.1.patch, HIVE-9556.2.patch, HIVE-9556.3.patch
>
>
> Levenshtein distance is a string metric for measuring the difference between two sequences.
Informally, the Levenshtein distance between two words is the minimum number of single-character
edits (i.e. insertions, deletions or substitutions) required to change one word into the other.
It is named after Vladimir Levenshtein, who considered this distance in 1965.
> Example:
> The Levenshtein distance between "kitten" and "sitting" is 3
> 1. kitten → sitten (substitution of "s" for "k")
> 2. sitten → sittin (substitution of "i" for "e")
> 3. sittin → sitting (insertion of "g" at the end).
> {code}
> select levenshtein('kitten', 'sitting');
> 3
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message