feat(sql): Vector SQL Integration + test isolation fixes

- Add VECTOR(n) column type support in CREATE TABLE
- Add CREATE INDEX ... USING hnsw/ivfpq for vector indexes
- Add cosine_distance(), euclidean_distance(), inner_product(), l1/l2_distance()
  SQL functions in expression evaluator
- Add <-> nearest-neighbor operator
- Fix ORDER BY with non-projected columns (move irpkSort before irpkProject)
- Fix execInsert to escape comma-containing values (vector literals)
- Fix MERGE tests by using unique temp dirs per test suite
- Add 8 Vector SQL Integration tests (all passing)
- Update PLAN_SQL_ADVANCED.md
This commit is contained in:
2026-05-14 14:14:13 +03:00
parent 96dfaaecb1
commit d076cfde3b
7 changed files with 357 additions and 72 deletions
+6
View File
@@ -204,6 +204,7 @@ type
tkConcat
tkCoalesce
tkFloorDiv
tkDistanceOp # <->
tkPlaceholder
# Special
@@ -572,6 +573,11 @@ proc nextToken*(l: var Lexer): Token =
discard l.advance()
return Token(kind: tkInvalid, value: "!", line: startLine, col: startCol)
of '<':
if l.pos + 2 < l.input.len and l.input[l.pos + 1] == '-' and l.input[l.pos + 2] == '>':
discard l.advance()
discard l.advance()
discard l.advance()
return Token(kind: tkDistanceOp, value: "<->", line: startLine, col: startCol)
if l.pos + 1 < l.input.len and l.input[l.pos + 1] == '=':
discard l.advance()
discard l.advance()