-
Notifications
You must be signed in to change notification settings - Fork 285
don't return error when vector index is empty #22659
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22508
What this PR does / why we need it:
empty index should return empty result
PR Type
Bug fix
Description
Return empty result instead of error when vector index is empty
Support multiple batches in search results processing
Update test expectations to reflect new behavior
Add integration test case for empty index queries
Diagram Walkthrough
flowchart LR A["Search Query"] --> B["Execute SQL"] B --> C{"Batches Empty?"} C -->|Old| D["Return Error"] C -->|New| E["Return Empty Result"] B --> F["Process Batches"] F --> G["Return Results"]File Walkthrough
search.go
Handle empty batches gracefully in searchpkg/vectorindex/ivfflat/search.go
search_test.go
Update tests for empty index behaviorpkg/vectorindex/ivfflat/search_test.go
mock_runSql_streamingtomock_runSqlmock_runSql_streaming_parser_errortomock_runSql_parser_errorrequire.NotNiltorequire.Nilfor emptyindex case
vector_ivf.sql
Add integration test for empty index querytest/distributed/cases/vector/vector_ivf.sql
vector_ivf.result
Add expected test results for empty querytest/distributed/cases/vector/vector_ivf.result