Skip to content

Commit 08d0a86

Browse files
committed
JARO_WINKLER
1 parent dcdfa40 commit 08d0a86

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed

docs/en/sql-reference/10-sql-commands/00-ddl/04-stream/create-stream.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CREATE [ OR REPLACE ] STREAM [ IF NOT EXISTS ] [ <database_name>. ]<stream_name>
2626
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2727
| `< database_name >` | A stream is treated as an object belonging to a specific database, similar to a table or a view. CREATE STREAM allows for different databases between the stream and the associated table. If a database is not explicitly specified, the current database is applied as the database for the stream you create. |
2828
| AT | When using `AT` followed by `TIMESTAMP =>`or `SNAPSHOT =>` , you can create a stream containing data changes after a specific historical point by the timestamp or snapshot ID; When `AT` is followed by `STREAM =>` , it allows for the creation of a new stream identical to an existing one, preserving the same captured data changes. |
29-
| APPEND_ONLY | When set to `true`, the stream operates in `Append-Only` mode; when set to `false`, it operates in `Standard` mode. Defaults to `false`. For additional details on stream operation modes, see [How Stream Works](/guides/load-data/continuous-data-pipelines/stream#how-stream-works). |
29+
| APPEND_ONLY | When set to `true`, the stream operates in `Append-Only` mode; when set to `false`, it operates in `Standard` mode. Defaults to `true`. For additional details on stream operation modes, see [How Stream Works](/guides/load-data/continuous-data-pipelines/stream#how-stream-works). |
3030

3131
## Examples
3232

docs/en/sql-reference/20-sql-functions/06-string-functions/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ This section provides reference information for the string-related functions in
3939
- [ORD](ord.md)
4040
- [POSITION](position.md)
4141
- [STRCMP](strcmp.md)
42+
- [JARO_WINKLER](jaro-winkler.md)
4243

4344
## Case Conversion:
4445
- [LCASE](lcase.md)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: JARO_WINKLER
3+
---
4+
5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="Introduced or updated: v1.2.675"/>
8+
9+
Calculates the [Jaro-Winkler distance](https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance) between two strings. It is commonly used for measuring the similarity between strings, with values ranging from 0.0 (completely dissimilar) to 1.0 (identical strings).
10+
11+
## Syntax
12+
13+
```sql
14+
JARO_WINKLER(<string1>, <string2>)
15+
```
16+
17+
## Return Type
18+
19+
The JARO_WINKLER function returns a FLOAT64 value representing the similarity between the two input strings. The return value follows these rules:
20+
21+
- Similarity Range: The result ranges from 0.0 (completely dissimilar) to 1.0 (identical).
22+
23+
```sql title='Examples:'
24+
SELECT JARO_WINKLER('databend', 'Databend') AS similarity;
25+
26+
┌────────────────────┐
27+
│ similarity │
28+
├────────────────────┤
29+
0.9166666666666666
30+
└────────────────────┘
31+
32+
SELECT JARO_WINKLER('databend', 'database') AS similarity;
33+
34+
┌────────────┐
35+
│ similarity │
36+
├────────────┤
37+
0.9
38+
└────────────┘
39+
```
40+
- NULL Handling: If either string1 or string2 is NULL, the result is NULL.
41+
42+
```sql title='Examples:'
43+
SELECT JARO_WINKLER('databend', NULL) AS similarity;
44+
45+
┌────────────┐
46+
│ similarity │
47+
├────────────┤
48+
│ NULL │
49+
└────────────┘
50+
```
51+
- Empty Strings:
52+
- Comparing two empty strings returns 1.0.
53+
54+
```sql title='Examples:'
55+
SELECT JARO_WINKLER('', '') AS similarity;
56+
57+
┌────────────┐
58+
│ similarity │
59+
├────────────┤
60+
│ 1 │
61+
└────────────┘
62+
```
63+
- Comparing an empty string with a non-empty string returns 0.0.
64+
65+
```sql title='Examples:'
66+
SELECT JARO_WINKLER('databend', '') AS similarity;
67+
68+
┌────────────┐
69+
│ similarity │
70+
├────────────┤
71+
│ 0 │
72+
└────────────┘
73+
```

0 commit comments

Comments
 (0)