-
Notifications
You must be signed in to change notification settings - Fork 852
Aggeragate function MAX() returns empty values #6728
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
I tried to reproduce the problem with 3.3.14 (and 3.3.16) with MMFiles and the following test setup:
This produces the same query execution plan:
The results are as expected for me however:
Can you confirm that the problem is reproducible with your dataset? How does the wrong query result actually look like, i.e. what values are returned for the MAX values in your case? |
@jsteemann I updated issue description with the result. The weird thing for me is that |
@jsteemann Question: How can I check if there are invalid values in my collection with AQL? Could you provide a code snippet? Thanks a lot. |
Ah ok, got it. It looks like the results for
This is because the empty string compares higher than any floating point value in AQL (please refer to the manual for the exact type and value order). If you add some filter conditions to the query, e.g.
it will filter out the non-numeric values and will not use them for the min/max calculation. |
OK - thanks for the explanation. I was totally focused on the description of the collect and aggregat usage here: Probably a hint on that manual page regarding the mentioned type order behaviour would be helpful to avoid wrong expectations. Maybe helpful for other users... Thanks for the filter statement. I added the code to my query as follows now the result is as expected. The complete query as reference for the solution of that issue:
|
Info: Inverted the provide filter to select all the none |
Uh oh!
There was an error while loading. Please reload this page.
My Environment
Component, Query & Data
Affected feature: AQL
AQL query (if applicable):
Result:
AQL explain (if applicable):
Dataset:
KnotenExtern holds GeoCoords stored as floats in "hw" and "rw" fields.
Replication Factor & Number of Shards (Cluster only):
Steps to reproduce
Execute the the query against datasets.
Problem:
MAX() results are empty.
Expected result:
MAX() should be filled at least with the MIN() values (if they were the same by accident).
The text was updated successfully, but these errors were encountered: