Enable auxiliary columns for rescore, IVF, and DiskANN indexes

The constructor previously rejected auxiliary columns (+col) for all
non-flat index types. Analysis confirms all code paths already handle
aux columns correctly — aux data lives in _auxiliary shadow table,
independent of the vector index structures.

Remove the three auxiliary column guards. Metadata and partition key
guards remain in place (separate analysis needed).

Adds 8 snapshot-based tests covering shadow table creation, insert+KNN
returning aux values, aux UPDATE, aux DELETE cleanup, and DROP TABLE
for both rescore and DiskANN. IVF aux verified with IVF-enabled build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Garcia 2026-03-31 18:27:02 -07:00
parent 01b4b2a965
commit b7fc459be4
6 changed files with 597 additions and 37 deletions

View file

@ -630,16 +630,19 @@ def test_diskann_command_search_list_size_error(db):
# Error cases: DiskANN + auxiliary/metadata/partition columns
# ======================================================================
def test_diskann_create_error_with_auxiliary_column(db):
"""DiskANN tables should not support auxiliary columns."""
result = exec(db, """
def test_diskann_create_with_auxiliary_column(db):
"""DiskANN tables should support auxiliary columns."""
db.execute("""
CREATE VIRTUAL TABLE t USING vec0(
emb float[64] INDEXED BY diskann(neighbor_quantizer=binary),
+extra text
)
""")
assert "error" in result
assert "auxiliary" in result["message"].lower() or "Auxiliary" in result["message"]
# Auxiliary shadow table should exist
tables = [r[0] for r in db.execute(
"SELECT name FROM sqlite_master WHERE name LIKE 't_%' ORDER BY 1"
).fetchall()]
assert "t_auxiliary" in tables
def test_diskann_create_error_with_metadata_column(db):