Repository navigation
Conversation
| if (name == key_field || name == data_field || name == metadata_field || name.starts_with('_')) { | ||
| // internal columns are the ones starting with an underscore, and a | ||
| // metadata key name may never start with one | ||
| if (name.starts_with('_')) { |
There was a problem hiding this comment.
the validate_metadata_key_name uses the same "_" prefix rule.
it's better to use a shared function for the case we change _ to $ (for one example)
| // validate the name of a metadata key. returns the reason the name is invalid, | ||
| // or std::nullopt if it is valid. the returned message has no subject, so that | ||
| // the caller could prefix it with the name as it appears in its own context | ||
| inline std::optional<std::string> validate_metadata_key_name(const std::string& name) { |
There was a problem hiding this comment.
it should allow only [a-zA-Z0-9] unless it is certain that lance FFI are blocking key-names which are not comply to that.
the column name should not contain double-quote(") , it may disrupt the datafusion expression.
There was a problem hiding this comment.
user may create key-names as $eq, $and, $or and other JSON query operators, it seems its not blocked upon create-index,put-vectors.
if that is the case, it will impact the query operation.
the validate_metadata_key_name should block meta-char in key-names.
There was a problem hiding this comment.
i can think of several directions with a solution for the field names:
- restrict column names to alphanumeric (maybe also underscores - mid name)
- pros: simple to document and explain
- cons: will make us much more restrictive than AWS
- distinguish filterable from regular column names
- for regular column names - probably no restrictions (also long as the JSON blob is valid). maybe even remove the exiting restrictions on starting with underscore
- maybe just prevent from filter ops ($rw, $or, $end), or to start with "$" in general to support any future ops
- for filterable column names, use the existing restrictions, and in addition, let lancedb reject whatever it does not like
- pros: would be AWS complient, since filterableMetadataFileds is an extension anyway
- cons: hard dodocument, especially, since we are not 100% what are (and going to be the lancedb restrictions)
There was a problem hiding this comment.
regarding the first option. looks like AWS API accepts all types of key names, including leadign and trailing spaces, dots, reserved filter operators etc.
e.g.:
[
{
"key": "my-vector-6",
"metadata": {
"my'key": "example"
}
},
{
"key": "my-vector-2",
"metadata": {
" mykey ": "example"
}
},
{
"key": "my-vector-1",
"metadata": {
"my key": "example"
}
},
{
"key": "my-vector-10",
"metadata": {
"`my-key`": "example"
}
},
{
"key": "my-vector-7",
"metadata": {
"המפתח שלי": "example"
}
},
{
"key": "my-vector-9",
"metadata": {
"my.key": "example"
}
},
{
"key": "my-vector-8",
"metadata": {
"$eq": "example"
}
},
{
"key": "my-vector-3",
"metadata": {
"'mykey'": "example"
}
},
{
"key": "my-vector-11",
"metadata": {
"my'key": "example"
}
},
{
"key": "my-vector-4",
"metadata": {
"\"mykey\"": "example"
}
},
{
"key": "my-vector-5",
"metadata": {
"my\"key": "example"
}
}
]
which makes filter like that valid:
filter={"$or": [{"$or": {"$eq": "example"}}, {"my.key": {"$eq": "example"}}]}
here the first "$or" is a filter operator and the 2nd "$or" is a key name.
There was a problem hiding this comment.
we need to verify whether our implementation can handle all of these combinations (as AWS)
There was a problem hiding this comment.
is this missing from the tests?
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
8fdc895 to
45c63d2
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
without raw_utf8 every byte of a multi-byte character was escaped on its own as a separate code point, so: "café" came back as "café" Signed-off-by: Yuval Lifshitz <[email protected]> Assisted-by: claude-code:claude-fable-5.1
45c63d2 to
c0612a8
Compare
* enforce the key name length only for declared keys * enforce backtics only for declared keys * make sure that utf8 keys are supported * make sure that keys are case sensitive * make sure that quotes and single quotes are supported Signed-off-by: Yuval Lifshitz <[email protected]> Assisted-by: claude-code:claude-opus-5
|
cherry picked to |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.