-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP Started developing ST_DISJOINT Initially based on ST_INTERSECTS * Fix functions list and add spatial point integration tests * Update docs/changelog/107007.yaml * More tests for shapes and cartesian-multigeoms * Some more tests to highlight issues with DISJOINT on cartesian point indices * Disable Lucene push-down for DISJOINT on cartesian point indices * Added docs for ST_DISJOINT * Support DISJOINT in the lucene-pushdown code for cartesian point indexes * Re-enable push-to-source for DISJOINT on cartesian_point indices * Fix docs example * Try fix internal docs links which are not being rendered * Fixed disjoint on empty geometry * Added tests on empty linestring, and changed lucene push-down to exception 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.
- Loading branch information
1 parent
887d48d
commit a7b3839
Showing
38 changed files
with
1,912 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 107007 | ||
summary: "ESQL: Support ST_DISJOINT" | ||
area: ES|QL | ||
type: enhancement | ||
issues: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
docs/reference/esql/functions/description/st_disjoint.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. | ||
|
||
*Description* | ||
|
||
Returns whether the two geometries or geometry columns are disjoint. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/reference/esql/functions/examples/st_disjoint.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. | ||
|
||
*Example* | ||
|
||
[source.merge.styled,esql] | ||
---- | ||
include::{esql-specs}/spatial_shapes.csv-spec[tag=st_disjoint-airport_city_boundaries] | ||
---- | ||
[%header.monospaced.styled,format=dsv,separator=|] | ||
|=== | ||
include::{esql-specs}/spatial_shapes.csv-spec[tag=st_disjoint-airport_city_boundaries-result] | ||
|=== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. | ||
|
||
[discrete] | ||
[[esql-st_disjoint]] | ||
=== `ST_DISJOINT` | ||
|
||
*Syntax* | ||
|
||
[.text-center] | ||
image::esql/functions/signature/st_disjoint.svg[Embedded,opts=inline] | ||
|
||
include::../parameters/st_disjoint.asciidoc[] | ||
include::../description/st_disjoint.asciidoc[] | ||
include::../types/st_disjoint.asciidoc[] | ||
include::../examples/st_disjoint.asciidoc[] |
9 changes: 9 additions & 0 deletions
9
docs/reference/esql/functions/parameters/st_disjoint.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. | ||
|
||
*Parameters* | ||
|
||
`geomA`:: | ||
Geometry column name or variable of geometry type | ||
|
||
`geomB`:: | ||
Geometry column name or variable of geometry type |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[discrete] | ||
[[esql-st_disjoint]] | ||
=== `ST_DISJOINT` | ||
|
||
experimental::[] | ||
|
||
*Syntax* | ||
|
||
[.text-center] | ||
image::esql/functions/signature/st_disjoint.svg[Embedded,opts=inline] | ||
|
||
*Parameters* | ||
|
||
`geomA`:: | ||
Expression of type `geo_point`, `cartesian_point`, `geo_shape` or `cartesian_shape`. If `null`, the function returns `null`. | ||
|
||
`geomB`:: | ||
Expression of type `geo_point`, `cartesian_point`, `geo_shape` or `cartesian_shape`. If `null`, the function returns `null`. | ||
The second parameter must also have the same coordinate system as the first. | ||
This means it is not possible to combine `geo_*` and `cartesian_*` parameters. | ||
|
||
include::description/st_disjoint.asciidoc[] | ||
This is the inverse of the <<esql-st_intersects,ST_INTERSECTS>> function. | ||
In mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅ | ||
|
||
include::types/st_disjoint.asciidoc[] | ||
include::examples/st_disjoint.asciidoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. | ||
|
||
*Supported types* | ||
|
||
[%header.monospaced.styled,format=dsv,separator=|] | ||
|=== | ||
geomA | geomB | result | ||
cartesian_point | cartesian_point | boolean | ||
cartesian_point | cartesian_shape | boolean | ||
cartesian_shape | cartesian_point | boolean | ||
cartesian_shape | cartesian_shape | boolean | ||
geo_point | geo_point | boolean | ||
geo_point | geo_shape | boolean | ||
geo_shape | geo_point | boolean | ||
geo_shape | geo_shape | boolean | ||
|=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.