-
Notifications
You must be signed in to change notification settings - Fork 25k
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
ESQL: Support ST_DISJOINT #107007
ESQL: Support ST_DISJOINT #107007
Conversation
Hi @craigtaverner, I've created a changelog YAML for you. |
f8def0f
to
26e8141
Compare
Pinging @elastic/es-analytical-engine (Team:Analytics) |
1ce06ef
to
d455155
Compare
Initially based on ST_INTERSECTS
d455155
to
e62c021
Compare
// Should never be null, but can be an empty geometry | ||
return new MatchNoDocsQuery(); | ||
// Should never be null, but could be an empty geometry | ||
return new MatchNoDocsQuery("Empty geometry"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct for disjoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment for empty geometries that I think needs addressing
…ption In lucene code only LineString can be empty, but in Elasticsearch even that is not allowed, resulting in parsing errors. So we cannot get to this code in the lucene push-down and now throw an error instead. The tests now assert on the warnings. Note that for any predicate DISJOINT and INTERSECTS alike, the predicate fails, because the parsing error results in null, the function returns null, the predicate interprets this as false, and no documents match. This null-in-null-out rule means that DISJOINT and INTERSECTS give the same answer on invalid geometries.
Following on from the ESQL spatial query work already done:
We add the fourth and final of the four Lucene-backed spatial search predicates:
ST_DISJOINT
. This is essentially the opposite ofST_INTERSECTS
such that if two geometries intersect, they are not disjoint, and if they do not intersect, they are disjoint. The PostGIS documentation can be comared at https://postgis.net/docs/ST_Disjoint.html