Open
Description
With a query like:
FROM airports
| EVAL distance = ST_DISTANCE(location, TO_GEOPOINT("POINT(-28.6359 153.5906)"))
| KEEP distance, location, name, scalerank
| WHERE distance > 500 AND scalerank < 6
| SORT name ASC
The literal geo-point is invalid (y value out of range), and this correctly leads to a null distance value. When run without Lucene pushdown, this query will return no results because the WHERE distance > 500
will evaluate to WHERE null
which is effectively WHERE false
. However, the Lucene pushdown of the distance predicate is not correctly filtering this, and results in all documents being returned (as if we had WHERE true
).
This issue is specific to the Lucene pushdown of the distance predicate, not an issue with WHERE
or predicates in general. However, since distance pushdown actually re-writes to ST_INTERSECTS
pushdown, we need to verify that the issue is not also for intersects and disjoint cases.