-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSQL filtering to support exist/not-exist checks for complex data (e.g. Target attributes/metadata) #2176
Comments
So, shortly written (pseudo code, null means not present, not "null" string):
and there is no support for:
I see two problems:
As far as I see there are two options:
|
After reading your comment noticed i've made a mistake regarding current behavior of complex data (attributes) with !=, =out= Behavior is same - it does not include null values , meaning they are evaluated only on attributes with key that have any value.(exists) Here is a detailed output of !=, ==, =in=, =out= for complex data:
|
Then the current behavior seems fine regarding the consistency. All operators work on targets HAVING the attribute (with the key).
I'd vote for the B option since it is clearer and more intuitive, no "special values", and most of all, it is SQL compatible. |
Currently all possible RSQL filters compare complex data (attributes, metadata) attribute.keys to some values - e.g.
In above examples some filter cases cannot be established - e.g.:
find all Targets with attribute.key that value is out of collection of values, OR attribute.key does not exist at all - e.g.:
!has(attribute.key) OR attribute.key=out=(value1,value2)
find all Targets that have given attribute.key regardless of value - e.g.:
has(attribute.key)
!! this actually can be achieved even now, but is not that intuitive (e.g. using wildcards attribute.key==*) and combining it in long rsql filter could be confusing
Applicable in all use-cases where given Targets are marked with different category - e.g.
If both
has(attribute.key) / !has(attribute.key)
could be supported by the RSQL filterng -> creating RSQL filters for above use-case could achieve easily (and intuitive) following searches (where currently not possible, or non-intuitive):-- filter all devices that support category1 (meaning have categor1, regardless of values)
-- filter all devices that support category2 ( meaning have category2, regardless of values)
-- filter all devices that support both category1 and category2 (meaning have category1 and category2, regardless of values)
-- filter only category1 (meaning have attribute.category1 regardless of value and does not have attribute.category2 at all)
-- filter only category2 (meaning have attribute.category2 regardless of value and does not have attribute.category1 at all)
The text was updated successfully, but these errors were encountered: