forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/elastic/elasticsearch into …
…fix_non_snapshot_error_messages
- Loading branch information
Showing
61 changed files
with
2,801 additions
and
2,166 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,32 @@ | ||
pr: 112063 | ||
summary: Spatial search functions support multi-valued fields in compute engine | ||
area: ES|QL | ||
type: bug | ||
issues: | ||
- 112102 | ||
- 112505 | ||
- 110830 | ||
highlight: | ||
title: "ESQL: Multi-value fields supported in Geospatial predicates" | ||
body: |- | ||
Supporting multi-value fields in `WHERE` predicates is a challenge due to not knowing whether `ALL` or `ANY` | ||
of the values in the field should pass the predicate. | ||
For example, should the field `age:[10,30]` pass the predicate `WHERE age>20` or not? | ||
This ambiguity does not exist with the spatial predicates | ||
`ST_INTERSECTS` and `ST_DISJOINT`, because the choice between `ANY` or `ALL` | ||
is implied by the predicate itself. | ||
Consider a predicate checking a field named `location` against a test geometry named `shape`: | ||
* `ST_INTERSECTS(field, shape)` - true if `ANY` value can intersect the shape | ||
* `ST_DISJOINT(field, shape)` - true only if `ALL` values are disjoint from the shape | ||
This works even if the shape argument is itself a complex or compound geometry. | ||
Similar logic exists for `ST_CONTAINS` and `ST_WITHIN` predicates, but these are not as easily solved | ||
with `ANY` or `ALL`, because a collection of geometries contains another collection if each of the contained | ||
geometries is within at least one of the containing geometries. Evaluating this requires that the multi-value | ||
field is first combined into a single geometry before performing the predicate check. | ||
* `ST_CONTAINS(field, shape)` - true if the combined geometry contains the shape | ||
* `ST_WITHIN(field, shape)` - true if the combined geometry is within the shape | ||
notable: false |
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
30 changes: 30 additions & 0 deletions
30
x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-airports-no-doc-values.json
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,30 @@ | ||
{ | ||
"properties": { | ||
"abbrev": { | ||
"type": "keyword" | ||
}, | ||
"name": { | ||
"type": "text" | ||
}, | ||
"scalerank": { | ||
"type": "integer" | ||
}, | ||
"type": { | ||
"type": "keyword" | ||
}, | ||
"location": { | ||
"type": "geo_point", | ||
"index": false, | ||
"doc_values": false | ||
}, | ||
"country": { | ||
"type": "keyword" | ||
}, | ||
"city": { | ||
"type": "keyword" | ||
}, | ||
"city_location": { | ||
"type": "geo_point" | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_geometries.json
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,19 @@ | ||
{ | ||
"properties": { | ||
"id": { | ||
"type": "long" | ||
}, | ||
"intersects": { | ||
"type": "boolean" | ||
}, | ||
"contains": { | ||
"type": "boolean" | ||
}, | ||
"shape": { | ||
"type": "geo_shape" | ||
}, | ||
"smaller": { | ||
"type": "geo_shape" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_points.json
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,22 @@ | ||
{ | ||
"properties": { | ||
"id": { | ||
"type": "long" | ||
}, | ||
"intersects": { | ||
"type": "boolean" | ||
}, | ||
"within": { | ||
"type": "boolean" | ||
}, | ||
"centroid": { | ||
"type": "geo_point" | ||
}, | ||
"location": { | ||
"type": "geo_point" | ||
}, | ||
"subset": { | ||
"type": "geo_point" | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_geometries.csv
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 @@ | ||
id:l, intersects:boolean, contains:boolean, shape:geo_shape, smaller:geo_shape | ||
0, true, true, ["GEOMETRYCOLLECTION(POLYGON ((-10 -10\, 0 -10\, 0 0\, -10 0\, -10 -10))\, POLYGON ((0 0\, 10 0\, 10 10\, 0 10\, 0 0)))"], ["GEOMETRYCOLLECTION(POLYGON ((-9 -9\, -1 -9\, -1 -1\, -9 -1\, -9 -9))\, POLYGON ((1 1\, 9 1\, 9 9\, 1 9\, 1 1)))"] | ||
1, true, true, ["MULTIPOLYGON( ((-10 -10\, 0 -10\, 0 0\, -10 0\, -10 -10))\, ((0 0\, 10 0\, 10 10\, 0 10\, 0 0)))"], ["MULTIPOLYGON( ((-9 -9\, -1 -9\, -1 -1\, -9 -1\, -9 -9))\, ((1 1\, 9 1\, 9 9\, 1 9\, 1 1)))"] | ||
2, true, true, ["POLYGON ((-15 -15\, 15 -15\, 15 15\, -15 15\, -15 -15))"], ["POLYGON ((-14 -14\, 14 -14\, 14 14\, -14 14\, -14 -14))"] | ||
3, true, true, ["POLYGON ((-15 -15\, 15 -15\, 15 15\, -15 15\, -15 -15))", "POLYGON ((15 15\, 25 15\, 25 25\, 15 25\, 15 15))"], ["POLYGON ((-14 -14\, 14 -14\, 14 14\, -14 14\, -14 -14))", "POLYGON ((16 16\, 24 16\, 24 24\, 16 24\, 16 16))"] | ||
4, true, true, ["POLYGON ((-10 -10\, 0 -10\, 0 0\, -10 0\, -10 -10))", "POLYGON ((0 0\, 10 0\, 10 10\, 0 10\, 0 0))"], ["POLYGON ((-9 -9\, -1 -9\, -1 -1\, -9 -1\, -9 -9))", "POLYGON ((1 1\, 9 1\, 9 9\, 1 9\, 1 1))"] | ||
5, true, false, ["POLYGON ((-5 -5\, 5 -5\, 5 5\, -5 5\, -5 -5))"], ["POLYGON ((-4 -4\, 4 -4\, 4 4\, -4 4\, -4 -4))"] | ||
6, true, false, ["POLYGON ((-5 -5\, 5 -5\, 5 5\, -5 5\, -5 -5))", "POLYGON ((15 15\, 25 15\, 25 25\, 15 25\, 15 15))"], ["POLYGON ((-4 -4\, 4 -4\, 4 4\, -4 4\, -4 -4))", "POLYGON ((16 16\, 24 16\, 24 24\, 16 24\, 16 16))"] | ||
7, true, false, ["POLYGON ((-9 -9\, -1 -9\, -1 -1\, -9 -1\, -9 -9))", "POLYGON ((1 1\, 9 1\, 9 9\, 1 9\, 1 1))"], ["POLYGON ((-8 -8\, -2 -8\, -2 -2\, -8 -2\, -8 -8))", "POLYGON ((2 2\, 8 2\, 8 8\, 2 8\, 2 2))"] | ||
8, false, false, ["POLYGON ((15 15\, 25 15\, 25 25\, 15 25\, 15 15))"], ["POLYGON ((16 16\, 24 16\, 24 24\, 16 24\, 16 16))"] | ||
9, false, false, ["POLYGON ((-25 -25\, -15 -25\, -15 -15\, -25 -15\, -25 -25))", "POLYGON ((15 15\, 25 15\, 25 25\, 15 25\, 15 15))"], ["POLYGON ((-24 -24\, -16 -24\, -16 -16\, -24 -16\, -24 -24))", "POLYGON ((16 16\, 24 16\, 24 24\, 16 24\, 16 16))"] | ||
10, true, false, ["POLYGON ((-15 -15\, 15 -15\, 15 15\, -15 15\, -15 -15))", "POLYGON ((5 5\, 15 5\, 15 15\, 5 15\, 5 5))"], ["POLYGON ((-14 -14\, 14 -14\, 14 14\, -14 14\, -14 -14))", "POLYGON ((6 6\, 14 6\, 14 14\, 6 14\, 6 6))"] | ||
11, true, false, ["POLYGON ((-11 -11\, 1 -11\, 1 1\, -11 1\, -11 -11))", "POLYGON ((-1 -1\, 11 -1\, 11 11\, -1 11\, -1 -1))"], ["POLYGON ((-10 -10\, 0 -10\, 0 0\, -10 0\, -10 -10))", "POLYGON ((0 0\, 10 0\, 10 10\, 0 10\, 0 0))"] |
Oops, something went wrong.