-
Notifications
You must be signed in to change notification settings - Fork 85
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
CQL2 - comparison with NULL values #963
Comments
From the standard:
If |
So the difference is that CQL2 logic is a 3 state logic, unlike the original CQL and OGC Filter, which was a 2 state logic (from OGC Filter, "The overall filter expression always evaluates to true or false"), and thus a system implementing both, needs to know where the filter was parsed from, and modify it accordingly? |
As far as I know/remember, there is no difference in the intention between CQL2, Filter Encoding. It was just that "unknown" was somehow folded into "false" in Filter Encoding, but without discussing the handling of NULL/unknown explicitly. @pvretano? The wording in CQL2 is the result of a discussion about this lack of clarity. See #841. |
I see the discussion and appreciate it... but at the same time, I don't think Filter Encoding left room for doubt. Quoting a full section of the introduction:
Quoting from section 9, comparison operators:
Same goes for spatial operators:
|
In any case, the logic in CQL2 is intentional. |
@cportele that's interesting, can you point me where in the Filter Encoding spec I can find that the comparison filter should return false for that case? In GeoTools we made some complex SQL encoding additions to force filter evaluation to a 2-state logic, if I can legitimately remove it, that would simplify things and I can point users back to this discussion (and would also allow 3-state logic to work out of the box at least against database sources). |
@aaime - As I wrote before, I don't think Filter Encoding is clear how to evaluate |
I am in the process of updating the geotools CQL2 module to match with the current version of the specifications, see geoserver/geoserver-ogcapi#10 for the context.
Relying on the ATS - A.3.5. conformance Test 8 - Table 7, the following filter:
"date"<>DATE('2022-04-16')
run onto thene_110m_populated_places_simple
dataset is expected to return only 2 features. In the current state of the GeoTools code, it returns 242 features instead. Opening the dataset into QGis, we can see that there are 240 NULL values which are also returned when querying the dataset with the filter.Shall we consider that a NULL date evaluates "different from '2022-04-16'" as the current GeoTools codebase does, or shall we exclude NULL values from the evaluation ?
The text was updated successfully, but these errors were encountered: