-
Notifications
You must be signed in to change notification settings - Fork 852
Unexpected behavior with undefined keys in AQL filters with numeric range expressions #4828
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
Comments
It is not necessarily unexpected result, at least when taking this comparison order into account
In the AQL type system, In order to check for documents that have a specific attribute defined and exclude all instances where the value is null, there are the following options:
|
I understand; however, this behavior makes it very difficult to compose complex numeric queries against highly variable document collections. We have a specific use case that requires running user-composed, complex scientific queries against schema-less documents. It seems I would need to pre-process these queries, and place "!null" terms where needed, but I don't see that as practical. Is it possible to add a feature to disable or alter the NULL evaluation behavior per query? If not, I think we will likely have to use a different metadata store/search engine. |
It will not be easy to adjust the behavior of |
Yes, that's what I meant by "pre-processing" the query. This would work, but since we're allowing user's to compose their own queries, this would require me to write some rather complex parsing code. I feel an existing search engine may be a better choice for time to solution with consistent/expected behavior plus a significant performance gain (which isn't a requirement for us now, but will be in the future). Thanks for the feedback, though! |
Closing as answered. Don't hesitate to ask if more aspects are unclear. |
my environment running ArangoDB
I'm using the latest ArangoDB of the respective release series:
Mode:
Storage-Engine:
On this operating system:
this is an AQL-related issue:
[ ] I'm using graph features
I'm issuing AQL via:
I've run
db._explain("<my aql query>")
and it didn't shed more light on this.The AQL query in question is:
"for i in docs filter i.x < 10 return i"
The issue can be reproduced using this dataset:
db.docs.save({x:-10,y:-5})
db.docs.save({y:5})
db.docs.save({x:5})
db.docs.save({x:20,y:10})
Please provide a way to create the dataset to run the above query on; either by a gist with an arangodump, or `db.collection.save({my: "values"}) statements. If it can be reproduced with one of the ArangoDB example datasets, it's a plus.
Foxx
this is a web interface-related issue: NO
I'm using the web interface with this browser: running on this OS:
These are the steps to reproduce:
_system
[ ] other:...
The following problem occurs: Result includes expected documents with 'x' < 10 (#1, and #3), but also returns the document without 'x' defined (doc #2).
Instead I would be expecting: Only documents that have 'x' defined and that meet the filter criteria (i.e. not NULL).
If the provided query is changed to "for i in docs filter i.x > -10 return i", the expected results are returned (i.e. it ignores documents where 'x' is not defined).
this is an installation-related issue: N/A
Describe which steps you carried out, what you expected to happen and what actually happened.
The text was updated successfully, but these errors were encountered: