Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cosine_distance for sparse vectors #24027

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mosabua
Copy link
Member

@mosabua mosabua commented Nov 4, 2024

Description

Still have to test this locally...

Additional context and related issues

follow up to #24005

Release notes

(*) Release notes are required, with the following suggested text:

## General 

* Add the {func}`cosine_distance` function for sparse vectors. ({issue}`tbd`)

@mosabua mosabua requested a review from dain November 4, 2024 18:50
@cla-bot cla-bot bot added the cla-signed label Nov 4, 2024
@mosabua mosabua marked this pull request as draft November 4, 2024 18:50
@github-actions github-actions bot added the docs label Nov 4, 2024
@@ -3457,6 +3457,25 @@ public void testCosineSimilarity()
.isNull(DOUBLE);
}

@Test
public void testCosineDistance()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we really need those tests ... in separate method or at all. Will see how they run and decide later

Calculates the cosine distance between two sparse vectors:

```sql
SELECT cosine_distance(MAP(ARRAY['a'], ARRAY[1.0]), MAP(ARRAY['a'], ARRAY[2.0]));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to verify this still

@mosabua mosabua force-pushed the sparse-distance branch 3 times, most recently from 82e3ad3 to 4b126bf Compare November 4, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant