Skip to content

Conversation

@QuerthDP
Copy link
Member

This patch introduce the validator integration tests for the vector_similarity() function added in ScyllaDB.

Refs: scylladb/scylladb#25993

@QuerthDP
Copy link
Member Author

The validator tests should pass after scylladb/scylladb#25993 is merged.

You can run them locally with:

run-validator-with-scylla-unshare [path_to_scylla] [path_to_vector_store] [path_to_validator] vector_similarity

@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch from 61fb2c7 to 017b06c Compare September 18, 2025 15:52
@QuerthDP
Copy link
Member Author

Changelog:

  • added tests for compound primary keys

It turned out the feature does not work properly if the SELECT does not contain whole primary key.
Turning the PR to draft until it's solved.

Furthermore I believe the tests can be refactored as they're very similar.

@QuerthDP QuerthDP marked this pull request as draft September 18, 2025 15:53
@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch from 017b06c to 6d9555e Compare September 18, 2025 15:54
@QuerthDP QuerthDP marked this pull request as ready for review September 22, 2025 10:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive integration tests for the vector_similarity() function in ScyllaDB. The tests validate that the function correctly returns similarity scores when used with ANN queries across different table schema configurations.

  • Adds integration tests for the vector_similarity() function across three different scenarios
  • Updates the create_index function to support additional options parameter for vector index configuration
  • Ensures existing tests continue to work by passing None for the new options parameter

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

File Description
crates/validator/src/tests/vector_similarity.rs New test file containing three test cases for the vector_similarity function
crates/validator/src/tests/mod.rs Registers the new vector_similarity test module
crates/validator/src/common.rs Updates create_index function to accept optional configuration parameters
crates/validator/src/tests/*.rs Updates existing test calls to pass None for the new options parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch 2 times, most recently from 302aaae to e608a06 Compare September 23, 2025 14:00
@QuerthDP
Copy link
Member Author

Changelog:

  • extract similarity function result checking
  • extract embeddings into a constant

@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch from e608a06 to 33bd1aa Compare September 24, 2025 07:43
@QuerthDP
Copy link
Member Author

Changelog:

  • removed the unnecessary comment
  • renamed check_similarity_function_results to assert_similarity_function_results

@QuerthDP QuerthDP requested a review from knowack1 September 24, 2025 07:44
@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch from 33bd1aa to b290b35 Compare September 24, 2025 07:47
@QuerthDP
Copy link
Member Author

Changelog:

  • renamed vector_similarity_function_returns_expected_results to vector_similarity_function_with_single_column_partition_key

knowack1
knowack1 previously approved these changes Sep 24, 2025
@knowack1 knowack1 mentioned this pull request Sep 24, 2025
@QuerthDP QuerthDP marked this pull request as draft October 2, 2025 08:27
Since the change we may create the indexes with different than default
vector index parameters like e.g. 'similarity_function'.
Add tests to validate the results of vector similarity functions
including:
  - `similarity_cosine` function returns proper results,
  - `similarity_euclidean` function returns proper results,
  - `similarity_dot_product` function returns proper results,
  - similarity function works well with multicolumn partition key,
  - similarity function works well with both partition and clustering key.

Refs: scylladb/scylladb#25993
@QuerthDP QuerthDP force-pushed the add-vector-similarity-integration-tests branch from b290b35 to 40414e5 Compare October 3, 2025 10:43
@QuerthDP
Copy link
Member Author

QuerthDP commented Oct 3, 2025

Changelog:

  • rebased on master
  • adjusted tests with new syntax of vector similarity functions
  • using options in lower case to check if db: fix option parsing #248 works properly

@QuerthDP QuerthDP requested a review from knowack1 October 3, 2025 10:45
@QuerthDP QuerthDP changed the title Add vector_similarity() function integration tests Add vector similarity functions integration tests Oct 3, 2025
@QuerthDP QuerthDP marked this pull request as ready for review October 17, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants