Skip to content

Conversation

@cofin
Copy link
Member

@cofin cofin commented Nov 26, 2025

Implements a vector search helper in the SQL builder. Generates dialect specific vector searches for Postgres, DuckDB, Oracle, BigQuery, and more.

cofin added 11 commits November 26, 2025 20:04
- Introduced a custom SQLGlot expression pattern for dialect-specific vector distance functions, allowing for tailored SQL generation based on the database dialect.
- Updated vector distance implementations for PostgreSQL, MySQL, Oracle, BigQuery, DuckDB, and Psycopg to support new distance metrics and improve SQL generation.
- Refactored tests for vector functions to ensure compatibility with the new implementations and added support for various distance metrics.
- Improved error handling and metadata management within vector distance expressions.
DuckDB infers decimal literals as DECIMAL type, but VSS functions like
array_distance, array_cosine_distance, and array_negative_inner_product
require DOUBLE[] arrays. This adds explicit CAST to DOUBLE[] for the
vector operand.

Also fixes bigquery fixture name from bigquery_driver to bigquery_session.
feat(builder): enhance subquery handling and parameter mapping in SelectClauseMixin

feat(vector): update VectorDistance expression to support dynamic array casting
@cofin cofin merged commit 87b4ad5 into main Nov 27, 2025
10 checks passed
@cofin cofin deleted the feat/vector-search branch November 27, 2025 05:44
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.

2 participants