Skip to content

Commit 26ce7e4

Browse files
authored
Update README.md
1 parent 9c9adf1 commit 26ce7e4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Full documentation can be found on the Couchbase Developer Portal.
1111
<hr>
1212

1313
## UDF Examples
14-
We have two different types of UDFs in Couchbase, using Javascript for the Query service and using Python for the Analytics service. Here, we showcase the same UDF functionality for the two services.
14+
We have two different types of UDFs in Couchbase, using Javascript for the Query service and using Python for the Analytics service. Here, we showcase the same UDF functionality of calculating the distance between two GPS coordinates for the two services.
1515
<hr>
1616

1717
### Query Service UDF using Javascript
1818

19-
Couchbase allows you to create User Defined Functions (UDF) with Javascript to include custom business logic inside your SQL++ queries while querying the data stored in Couchbase.
19+
Couchbase allows you to create User Defined Functions (UDF) with Javascript to include custom business logic inside your SQL++ queries while querying the data stored in Couchbase. Here, we create a custom UDF that calculates the distance between two GPS coordinates using the [Haversine formula](https://en.wikipedia.org/wiki/Haversine_formula).
2020

2121
#### Importing the UDF in Couchbase
2222

@@ -67,6 +67,9 @@ Couchbase Analytics supports creating custom User Defined Functions using Python
6767
#### Install requirements
6868

6969
- `$ pip install -r requirements.txt`
70+
71+
### UDF Code
72+
- The UDF code is [here](analytics-udf-python/distance-lib/distance_library.py).
7073

7174
#### Testing the UDF
7275

0 commit comments

Comments
 (0)