Implement a SQL, Qdrant SQL?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 34.7k
- Forks
- 2.7k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 187
Description
I think it could be very useful to have a QSQL, or being optimistic it could become a standard for vector databases, VSQL?
Instead of dealing with JSON in qdrant http api or all the methods in Python API for example. Queries can be written easily in the same way for scroll api and search api, in plain SQL. It can be useful for the qdrant dashboard or even for production queries.
The generated abstract syntax tree (AST), can match all qdrant features for searching and scrolling.
SELECT score, vector, id, payload.brand_name
FROM mycollection
WHERE vector LIKE [0.12, 0.1, 0.99, -0.01]
field score is a virtual calculated field that is returned when using LIKE for vectors
in the case of having named vectors, it would be like:
SELECT score, vectors.img_vec, id, payload.qty_items
FROM mycollection
WHERE vectors.img_vec LIKE [0, 1.2, -0.2, 0.001]
limit, offset and filtering payload
SELECT score, id, payload.qty_items
FROM mycollection
WHERE vector LIKE [0.1, 0.2, -0.3, 0.11] AND payload.brand_name = 'Nokia'
LIMIT 50
OFFSET 20
all payload and filtering
SELECT score, id, payload.*
FROM mycollection
WHERE vector LIKE [0.11, -0.2, 0.3, 0.22] AND payload.brand_name = 'Nokia'
LIMIT 100
complex filtering
SELECT score, id
FROM mycollection
WHERE vector LIKE [0.01, -0.9, 0.11, 0.0]
AND (payload.brand_name IN ('Nokia', 'Alcatel', 'Sony') OR payload.qty_items >= 10)
AND payload.members IS NULL
LIMIT 100
scroll api (no vector similarity search). Filtering fulltext, values count and range, plus sorting
SELECT id, payload.*
FROM mycollection
WHERE payload.brand_name MATCH 'cell'
AND LENGTH(payload.members) > 100
AND payload.qty_items BETWEEN 10 AND 20
ORDER BY payload.members DESC
LIMIT 100
geo bounding box filtering
SELECT score, id
FROM mycollection
WHERE vector LIKE [0.01, -0.9, 0.11, 0.0]
AND (
payload.geofield INSIDE RECTANGLE(52.520711, 13.403683, 52.495862, 13.455868)
OR
payload.geofield INSIDE CIRCLE(52.520711, 13.403683, 1000)
OR
payload.geofield OUTSIDE POLYGON([12.444, 54.12], [24.77, 18.222], [99.91, 12.2])
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SQL examples in the issue and review Qdrant's existing search, scroll, filtering, sorting, and geo-query interfaces to determine the scope of a SQL layer. Done would require an agreed query syntax and AST that covers the intended Qdrant features; the issue does not name implementation files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100