Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
bf5c145
Support geohash, geotile and geohex grid types
craigtaverner Jun 17, 2025
9963d1d
Update docs/changelog/129581.yaml
craigtaverner Jun 17, 2025
b84befe
Use type-casting syntax to be sure it works
craigtaverner Jun 17, 2025
98cc504
Merge branch 'esql_geogrid_types' of github.com:craigtaverner/elastic…
craigtaverner Jun 17, 2025
a095433
Fix changelog yaml
craigtaverner Jun 17, 2025
996d1ed
New capability due to behaviour change
craigtaverner Jun 18, 2025
71ca7bb
Fix failing tests
craigtaverner Jun 18, 2025
252f539
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Jun 18, 2025
625d918
Disable broken lucene pushdown
craigtaverner Jun 18, 2025
5f3d5aa
Merge branch 'main' into esql_geogrid_types
craigtaverner Jun 18, 2025
53ea500
Fix failing tests
craigtaverner Jun 20, 2025
92201e1
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Jul 4, 2025
ade842b
Regenerate docs after merging main
craigtaverner Jul 4, 2025
c152331
Some fixes after review
craigtaverner Jul 4, 2025
bbd8c1d
Remove unneeded change
craigtaverner Jul 4, 2025
7b5c3da
Code review updates
craigtaverner Jul 10, 2025
aebb19b
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Jul 10, 2025
bc6ce57
[CI] Auto commit changes from spotless
Jul 10, 2025
0a81d1d
Fix some errors after moving from esType
craigtaverner Jul 11, 2025
30614fc
Bring back esType since it is required for outputType
craigtaverner Jul 11, 2025
5b71ab9
Merge branch 'esql_geogrid_types' of github.com:craigtaverner/elastic…
craigtaverner Jul 11, 2025
1c0359e
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Jul 11, 2025
100bb3b
Remove int support from to_geo* functions
craigtaverner Jul 11, 2025
004c4a5
Merge branch 'main' into esql_geogrid_types
craigtaverner Jul 11, 2025
7890d40
Merge branch 'main' into esql_geogrid_types
craigtaverner Jul 12, 2025
004d2c9
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Aug 20, 2025
891de41
Fixed min/max after merging main
craigtaverner Aug 20, 2025
45fcb7c
Merge branch 'esql_geogrid_types' of github.com:craigtaverner/elastic…
craigtaverner Aug 20, 2025
bd6c5c2
Fixed intersects/disjoint after merging main
craigtaverner Aug 20, 2025
cc506a9
Fix after merging main
craigtaverner Aug 20, 2025
507deab
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Aug 21, 2025
bee7b70
Fix tests after merging main
craigtaverner Aug 21, 2025
879abcd
Fix tests after merging main
craigtaverner Aug 21, 2025
e8ac2ad
Put grid types back into snapshot and assert that functions only work…
craigtaverner Aug 25, 2025
0f5ddef
Move type-conversion functions to snapshot as well
craigtaverner Aug 25, 2025
589720f
Fix failing test after moving functions to snapshot
craigtaverner Aug 25, 2025
b5830f0
Commit kibana specs after moving function to snapshot
craigtaverner Aug 25, 2025
7ac9c8d
Add missing unit tests for new conversion functions
craigtaverner Aug 25, 2025
8669be9
Add missing docs for to_geo-grid functions
craigtaverner Aug 25, 2025
48fbc9f
Merge branch 'main' into esql_geogrid_types
craigtaverner Aug 25, 2025
8c271a7
Simplify type checks
craigtaverner Aug 25, 2025
819e896
Redirects to work around build issue in docs-builder
craigtaverner Aug 25, 2025
0360aa2
Redirects to work around build issue in docs-builder
craigtaverner Aug 25, 2025
0351442
Using joe to add back trailing whitespace
craigtaverner Aug 25, 2025
3669cb2
Try multi-line redirects
craigtaverner Aug 26, 2025
681dc30
Try absolute path
craigtaverner Aug 26, 2025
ed4b6a3
Merge branch 'main' into esql_geogrid_types
craigtaverner Aug 26, 2025
1c4ee72
Fixed failing tests after type resolution simplification
craigtaverner Aug 26, 2025
f12945e
Return to single-line redirects
craigtaverner Aug 26, 2025
355c18d
Rename function to improve clarity
craigtaverner Aug 26, 2025
00ad3ce
Merge remote-tracking branch 'origin/main' into esql_geogrid_types
craigtaverner Aug 26, 2025
6cd7e25
Remove support for geogrid in ST_INTERSECTS
craigtaverner Aug 26, 2025
e32f202
Revert "Remove support for geogrid in ST_INTERSECTS"
craigtaverner Aug 26, 2025
44cd323
Update docs/changelog/133546.yaml
craigtaverner Aug 26, 2025
9d29ed4
Fix changelog
craigtaverner Aug 26, 2025
1fdf167
Merge remote-tracking branch 'origin/main' into esql_geogrid_intersects
craigtaverner Aug 27, 2025
d6a8a19
Fix evaluators after merging in main
craigtaverner Aug 27, 2025
742aab9
Merge remote-tracking branch 'origin/main' into esql_geogrid_intersects
craigtaverner Sep 1, 2025
f7c5919
Protect ST_INTERSECTS grid calls with capabilities
craigtaverner Sep 1, 2025
e0a41a8
Merge remote-tracking branch 'origin/main' into esql_geogrid_intersects
craigtaverner Sep 1, 2025
13bf91f
Added csv-spec tests for ST_DISJOINT and fixed a bug
craigtaverner Sep 2, 2025
9aa2f03
Merge remote-tracking branch 'origin/main' into esql_geogrid_intersects
craigtaverner Sep 2, 2025
b914956
Response to code review
craigtaverner Sep 2, 2025
2e71e39
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 2, 2025
e35d3ab
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 3, 2025
9a265a3
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 4, 2025
6493c6c
Disable SPATIAL_GRID_INTERSECTS in CCS tests
craigtaverner Sep 4, 2025
a0a4bb6
Ensure supportsGrid is true on node deserialization.
craigtaverner Sep 4, 2025
222599e
Remove block on MultiClusterSpecIT
craigtaverner Sep 4, 2025
1bc4e3e
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 4, 2025
409789b
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 5, 2025
5275208
Merge branch 'main' into esql_geogrid_intersects
craigtaverner Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/133546.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 133546
summary: "Support geohash, geotile and geohex grid types in ST_INTERSECTS and ST_DISJOINT"
area: "ES|QL"
type: enhancement
issues: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected void shouldSkipTest(String testName) throws IOException {
hasCapabilities(adminClient(), List.of(ENABLE_LOOKUP_JOIN_ON_REMOTE.capabilityName()))
);
}
// Unmapped fields require a coorect capability response from every cluster, which isn't currently implemented.
// Unmapped fields require a correct capability response from every cluster, which isn't currently implemented.
assumeFalse("UNMAPPED FIELDS not yet supported in CCS", testCase.requiredCapabilities.contains(UNMAPPED_FIELDS.capabilityName()));
// Tests that use capabilities not supported in CCS
assumeFalse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,62 @@ count:long | centroid:geo_point | geohashString:keywo
2 | POINT (16.706149326637387 32.37822346854955) | sm | POLYGON((11.25 28.125, 22.5 28.125, 22.5 33.75, 11.25 33.75, 11.25 28.125))
;

gridGeohashDocsFromCell
required_capability: spatial_grid_intersects

FROM airports
| WHERE ST_INTERSECTS(location, TO_GEOHASH("u1"))
| STATS
count = COUNT(*),
centroid = ST_CENTROID_AGG(location)
;

count:long | centroid:geo_point
8 | POINT (6.351574736181647 51.8981519783847)
;

gridIntersectsDisjointGeohash
required_capability: spatial_grid_intersects

FROM airports
| EVAL intersects = ST_INTERSECTS(location, "u1"::geohash)
| EVAL disjoint = ST_DISJOINT(location, "u1"::geohash)
| STATS count = COUNT(*) BY intersects, disjoint
| SORT count ASC
;

count:long | intersects:boolean | disjoint:boolean
8 | true | false
883 | false | true
;

gridGeohashLiteralFromCell
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (6.351574736181647 51.8981519783847)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = TO_GEOPOINT(location)
| MV_EXPAND location
| WHERE ST_INTERSECTS(location, "u1"::geohash)
;

location:geo_point
POINT (6.351574736181647 51.8981519783847)
;

gridGeohashLiteralFromCellDisjoint
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (6.351574736181647 51.8981519783847)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = location::geo_point
| MV_EXPAND location
| WHERE ST_DISJOINT(location, "u1"::geohash)
;

location:geo_point
POINT (6.360728044651057 47.94084087577894)
POINT (5.268637698941997 42.747250193330856)
;

gridGeohashStatsByWhereUK
required_capability: spatial_grid_types

Expand Down Expand Up @@ -688,6 +744,62 @@ count:long | centroid:geo_point | geotileString:keywor
79 | POINT (24.516750878736943 23.93036561181085) | 3/4/3 | POLYGON((0.0 0.0, 45.0 0.0, 45.0 40.979898069620134, 0.0 40.979898069620134, 0.0 0.0))
;

gridGeotileDocsFromCell
required_capability: spatial_grid_intersects

FROM airports
| WHERE ST_INTERSECTS(location, TO_GEOTILE("3/4/3"))
| STATS
count = COUNT(*),
centroid = ST_CENTROID_AGG(location)
;

count:long | centroid:geo_point
79 | POINT (24.516750878736943 23.93036561181085)
;

gridIntersectsDisjointGeotile
required_capability: spatial_grid_intersects

FROM airports
| EVAL intersects = ST_INTERSECTS(location, "3/4/3"::geotile)
| EVAL disjoint = ST_DISJOINT(location, "3/4/3"::geotile)
| STATS count = COUNT(*) BY intersects, disjoint
| SORT count ASC
;

count:long | intersects:boolean | disjoint:boolean
79 | true | false
812 | false | true
;

gridGeotileLiteralFromCell
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (24.516750878736943 23.93036561181085)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = TO_GEOPOINT(location)
| MV_EXPAND location
| WHERE ST_INTERSECTS(location, "3/4/3"::geotile)
;

location:geo_point
POINT (24.516750878736943 23.93036561181085)
;

gridGeotileLiteralFromCellDisjoint
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (24.516750878736943 23.93036561181085)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = location::geo_point
| MV_EXPAND location
| WHERE ST_DISJOINT(location, "3/4/3"::geotile)
;

location:geo_point
POINT (6.360728044651057 47.94084087577894)
POINT (5.268637698941997 42.747250193330856)
;

gridGeotileStatsByWhereUK
required_capability: spatial_grid_types

Expand Down Expand Up @@ -1123,6 +1235,62 @@ POINT (13.1442589810713 32.6691695504993) | 813fbffffffffff | 813fbffffffffff
POINT (118.12696884672 24.537192570557) | 8141bffffffffff | null | POLYGON ((121.34751445935747 26.200276060455465, 120.50339385995798 29.892985338693542, 116.26130043917948 31.68090796798786, 112.74092235558841 29.367231998154967, 113.70376749169584 25.199133186716526, 117.99047716641066 23.5089519597363, 119.64146543031175 24.728661050965922, 121.34751445935747 26.200276060455465))
;

gridGeohexDocsFromCell
required_capability: spatial_grid_intersects

FROM airports
| WHERE ST_INTERSECTS(location, TO_GEOHEX("81397ffffffffff"))
| STATS
count = COUNT(*),
centroid = ST_CENTROID_AGG(location)
;

count:long | centroid:geo_point
7 | POINT (2.475211258445467 41.32352174592337)
;

gridIntersectsDisjointGeohex
required_capability: spatial_grid_intersects

FROM airports
| EVAL intersects = ST_INTERSECTS(location, "81397ffffffffff"::geohex)
| EVAL disjoint = ST_DISJOINT(location, "81397ffffffffff"::geohex)
| STATS count = COUNT(*) BY intersects, disjoint
| SORT count ASC
;

count:long | intersects:boolean | disjoint:boolean
7 | true | false
884 | false | true
;

gridGeohexLiteralFromCell
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (2.475211258445467 41.32352174592337)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = TO_GEOPOINT(location)
| MV_EXPAND location
| WHERE ST_INTERSECTS(location, "81397ffffffffff"::geohex)
;

location:geo_point
POINT (2.475211258445467 41.32352174592337)
POINT (5.268637698941997 42.747250193330856)
;

gridGeohexLiteralFromCellDisjoint
required_capability: spatial_grid_intersects

ROW location = ["POINT (6.360728044651057 47.94084087577894)", "POINT (2.475211258445467 41.32352174592337)", "POINT (5.268637698941997 42.747250193330856)"]
| EVAL location = TO_GEOPOINT(location)
| MV_EXPAND location
| WHERE ST_DISJOINT(location, "81397ffffffffff"::geohex)
;

location:geo_point
POINT (6.360728044651057 47.94084087577894)
;

gridGeohexStatsByWhereUK
required_capability: spatial_grid_types

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading