feat: DuckDB extension for zvec collections (MVP)#136
Open
akuligowski9 wants to merge 1 commit intoalibaba:mainfrom
Open
feat: DuckDB extension for zvec collections (MVP)#136akuligowski9 wants to merge 1 commit intoalibaba:mainfrom
akuligowski9 wants to merge 1 commit intoalibaba:mainfrom
Conversation
Implements a collection-bridge DuckDB extension with 4 SQL functions: - zvec_create(path, schema_json): create collections from JSON schema - zvec_insert(path, pk, doc_json): insert documents with JSON fields - zvec_search(path, field, vector, topk): vector similarity search - zvec_fetch(path, pk): fetch documents by primary key Includes thread-safe CollectionRegistry, full type mapping between zvec and DuckDB types, JSON schema parser, and SQL tests. Closes alibaba#134 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73a1766 to
d3724aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zvec_create,zvec_insert,zvec_search(table function),zvec_fetch(table function)CollectionRegistry, full zvec↔DuckDB type mapping, JSON schema parser, and SQL testsDesign Decisions (seeking feedback)
FLOAT[]arrays, converted to zvec raw binary format internally.Functions
zvec_create(path VARCHAR, schema_json VARCHAR) → VARCHARzvec_insert(path VARCHAR, pk VARCHAR, doc_json VARCHAR) → VARCHARzvec_search(path VARCHAR, field VARCHAR, vector FLOAT[], topk INT) → (pk, score, ...fields)zvec_fetch(path VARCHAR, pk VARCHAR) → (pk, ...fields)Example Usage
Test plan
makebuilds the extension without errors against a DuckDB submoduleCloses #134
🤖 Generated with Claude Code