Repository navigation
Add validation for invalid METRIC when creating VECTOR INDEX - #6
srodriguez-cenfotec wants to merge 4 commits into
Conversation
|
The missing-METRIC validation should only run when a WITH (...) clause is present. The syntax makes the entire clause optional, so a bare CREATE VECTOR INDEX ... should remain valid, while WITH (TYPE = DiskANN) should report the missing METRIC. As written, the check after the optional WITH clause rejects the bare form too.\n\nPlease apply the same validation to TSql180.g as well as TSql170.g; the latest parser has an independent vector-index rule and currently accepts WITH (TYPE = DiskANN) without an error.\n\nPlease add coverage for both parser versions: bare index succeeds; WITH (METRIC = cosine) succeeds; and WITH (TYPE = DiskANN) fails for missing METRIC. Also preserve the existing SQL46010 expectations for malformed syntax (e.g. options without WITH), so the new validation does not mask syntax errors. Given the optional clause, the baseline edits that add METRIC to bare-index examples should be reconsidered. |
Summary
Sql170 ad TSql180 have been updated to validate the cases where the clause has been added and no metric was defined
Implementation
The grammar rules for T
TDD Evidence
RED: Without the validation, the focused test failed 1/1 because the validation was missing
GREEN: With the validation enabled, the same focused test passed 1/1.
Testing
Passed: dotnet test /p:TargetFramework=net8.0