Skip to content

rgw/s3vectors: support put/get/list/query metadata - #67851

Closed
yuvalif wants to merge 35 commits into
ceph:wip-s3vectorfrom
yuvalif:wip-s3vector-metadata
Closed

yuvalif wants to merge 35 commits into
ceph:wip-s3vectorfrom
yuvalif:wip-s3vector-metadata

Conversation

@yuvalif

@yuvalif yuvalif commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor
  • d93bed5 - Store and retrieve opaque JSON metadata on vectors (put/get/list/query)
  • 00ec4e6 - Store nonFilterableMetadataKeys as lancedb table metadata for get_index round-trip
  • e1359a3 - Add filterableMetadataKeys extension: dynamically add typed columns to the lancedb schema
  • d84e219 - Support list types (StringList, NumberList, BooleanList) for filterable metadata fields
  • e479b81 - Validate metadata is well-formed JSON and filterable field values match their declared types
  • 31038fa _-Return ValidationException with fieldList for PutVectors errors (dimension mismatch, type mismatch, malformed metadata)
  • 200ebb9 - Return 409 on duplicate CreateIndex (remove idempotent logic), return ValidationException with fieldList for schema errors and filterable/non-filterable key overlap
  • 2ed5cce - bail on first error
  • b0603ab - dont store filterable keys as table metadata. instead extract it from the table schema. filterable keys are all columns that are not "key", "data", "metadata" or start with an underscore (for future proof changes to the hardcoded schema)
  • a0cf765 - add allowNull indication (optional, defaults to true) inidication
  • 6afb28d - metadata filtering. still missing:
    • fieldList error messaging (6a332b0)
    • add a topK factor for post filtering (7cb3a79)
    • support list types of columns and json fields (require lancedb-c change)
  • f09d3da - proper error handling when unable to get non-filterable keys or dimensions
  • 3305092- postFiltering flag to allow user to explicitly workaround the mixed "OR" condition issue
  • d5597d2 - treating $eq on array value as an error
  • f7ff574 - more error case coverage
  • 843f762 - reject null values and dots in field names
  • 72212e0 - use std::from_chars instead of srd::stod
  • f3e7879 reject an empty array of conditions
  • 1019250 - change allowNull to mustExist

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

yuvalif added 8 commits April 23, 2026 05:31
do some fixes to message validation based on the tesst

Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
not implemented in this commit:
* caching information as VectorBucket attributes and fetching them from
  there: schema, distance type
* VectorBucket policy APIs
* metadata support

Signed-off-by: Yuval Lifshitz <[email protected]>
also fix shaman build failures with lancedb-c. see:
https://shaman.ceph.com/builds/ceph/wip-add-lancedb/e7ce95d8e2e279b373f3c486bd1f64c39b23883f/

note that currently we are testing only against centos
since the rust version in ubuntu jammy and noble is too old for lancedb

liblancedb.so is installed as part of the ceph_base

Signed-off-by: Yuval Lifshitz <[email protected]>
use non-system user. similar to fix here:
8935c1f

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif requested a review from a team as a April 26, 2026 06:23
see: lancedb/lancedb-c#45
also run test on rpm latest (rocky10)

Signed-off-by: Yuval Lifshitz <[email protected]>
* wait for longer than sleep idle time for graceful shutdown
* empty queue on shutdown
* avoud double join on non-graceful shutdown

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif force-pushed the wip-s3vector-metadata branch from e86ff18 to 126ef20 Compare April 30, 2026 13:43
@dmick

dmick commented Apr 30, 2026

Copy link
Copy Markdown
Member

Why is build-sig manually requested as a reviewer on this?

@yuvalif

yuvalif commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Why is build-sig manually requested as a reviewer on this?

probably a mistake. will remove

Comment thread src/rgw/rgw_s3vector.cc Resolved
@galsalomon66

Copy link
Copy Markdown
Contributor

on rgw_s3vector.cc : 2052
this scope (count !=0) is missing lancedb_expr_free(json_filter_expr);

Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
yuvalif added 2 commits June 2, 2026 17:17
in case tha tthe query uses an OR condition between
JSON metadata fileds and a metadata column we allow
for a workaround that allows the user to treat all fileds
as JSON, even if they exist in the table

Signed-off-by: Yuval Lifshitz <[email protected]>
"max":10,
"min":0
},
"FilterableMetadataKeyEntry":{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be a doc on s3vectors implementation in RGW (esp.,about these custom fields usage)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no documentation yet.
I'll create one once the implementation gets it final form.

regarding FilterableMetadataKeyEntry, this allows the user to create "virtual columns" based on the JSON metadata field. since there is not defined schema for the JSON metadata, we cannot treat all fields as "virtual columns", since they might end up with huge number of sparse columns.
if the user knows which JSON fields are common in many rows, we have this field to allow adding such definition. if only field name is there, we assume a string field. optionally, the user can define the type of the field, as well as a flag indicating if null values are allowed

Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
* "exists" must get a booelan field
* `infer_value_type` check noin basic types
* top level logical operators expect array of conditions
* "nin/in` must get an array field

Signed-off-by: Yuval Lifshitz <[email protected]>
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
@yuvalif

yuvalif commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor Author

remaining work that will be handled in separate PRs:

null values are currently rejected:
* no support in the expr api of lancedb-c
* for filterable columns that allow nulls, it is not possible
  to distinguish null value from missing field

metadata field names with dots are rejected:
* dots are not allowed in lancedb column names
* we reject from all metadata fields to allow support
  on nested field filtering in the future. we will use dot
  notations for the path of the field, and this will be ambiguous
  if we allow for dots in field names

Signed-off-by: Yuval Lifshitz <[email protected]>
Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector.cc Resolved
Comment thread src/rgw/rgw_s3vector_filter.cc Resolved
yuvalif added 2 commits June 15, 2026 20:47
since there is no null support for now

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif

yuvalif commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

aquashed and cherry picked into: #66066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants