Skip to content

CNDB-14343: Fix ANN queries on primary key and static columns #1800

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adelapena
Copy link

We can create a vector index on primary key components and static columns and query an empty table. Still, if an ANN query finds any data, we get an unmanaged replica-side error saying that only regular columns are supported.

For now, I'm just adding some reproduction tests here.

Copy link

Checklist before you submit for review

  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one

@adelapena adelapena marked this pull request as ready for review June 11, 2025 13:44
Comment on lines 70 to 69
if (!column.isRegular())
return true;
Copy link
Member

Choose a reason for hiding this comment

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

I think this is only correct for Primary Key columns since those cannot be updated to a new value. Static columns can be updated and that means we need to validate their source ss/mem table.

Copy link
Author

Choose a reason for hiding this comment

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

I have added a tiny test case for updating a static column similar to that of VectorUpdateDeleteTest.testUpdateVectorToWorseAndBetterPositions. It seems to work, but it probably needs more testing.

@adelapena adelapena self-assigned this Jul 1, 2025
@adelapena adelapena marked this pull request as draft July 1, 2025 10:50
@adelapena adelapena marked this pull request as ready for review July 1, 2025 15:41
Copy link

sonarqubecloud bot commented Aug 1, 2025

@cassci-bot
Copy link

✔️ Build ds-cassandra-pr-gate/PR-1800 approved by Butler


Approved by Butler
See build details here

@adelapena adelapena changed the title CNDB-14343: Vector indexes on non-regular columns can be created but not queried CNDB-14343: Fix ANN queries on primary key and static columns Aug 1, 2025
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.

3 participants