-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(functions): add jaro_winkler string similarity function
- Loading branch information
Showing
4 changed files
with
259 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
tests/sqllogictests/suites/query/functions/02_0079_function_strings_jaro_winkler.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
query T | ||
SELECT jaro_winkler(NULL, 'hello') | ||
---- | ||
NULL | ||
|
||
query T | ||
SELECT jaro_winkler('hello', NULL) | ||
---- | ||
NULL | ||
|
||
query T | ||
SELECT jaro_winkler(NULL, NULL) | ||
---- | ||
NULL | ||
|
||
query T | ||
SELECT jaro_winkler('', '') | ||
---- | ||
1.0 | ||
|
||
query T | ||
SELECT jaro_winkler('hello', 'hello') | ||
---- | ||
1.0 | ||
|
||
query T | ||
SELECT jaro_winkler('hello', 'helo') | ||
---- | ||
0.9533333333333333 | ||
|
||
query T | ||
SELECT jaro_winkler('martha', 'marhta') | ||
---- | ||
0.9611111111111111 | ||
|
||
query T | ||
SELECT jaro_winkler('你好', '你好啊') | ||
---- | ||
0.9333333333333333 | ||
|
||
query T | ||
SELECT jaro_winkler('🦀hello', '🦀helo') | ||
---- | ||
0.9777777777777777 | ||
|
||
query T | ||
SELECT jaro_winkler('dixon', 'dicksonx') | ||
---- | ||
0.8133333333333332 | ||
|
||
query T | ||
SELECT jaro_winkler('duane', 'dwayne') | ||
---- | ||
0.8400000000000001 | ||
|
||
query T | ||
select jaro_winkler('asdf', 'as x c f'); | ||
---- | ||
0.6592592592592592 | ||
|
||
query T | ||
SELECT jaro_winkler('', 'hello') | ||
---- | ||
0.0 |