Skip to content

Commit

Permalink
Merge branch 'main' into auto-casting-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fang-xing-esql committed Apr 2, 2024
2 parents b96be99 + ee6ff33 commit 55a8f30
Show file tree
Hide file tree
Showing 183 changed files with 6,364 additions and 3,343 deletions.
2 changes: 0 additions & 2 deletions .buildkite/pipelines/periodic.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ steps:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
GRADLE_TASK:
- checkPart1
- checkPart2
Expand All @@ -108,7 +107,6 @@ steps:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
BWC_VERSION: $BWC_LIST
agents:
provider: gcp
Expand Down
2 changes: 0 additions & 2 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ steps:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
GRADLE_TASK:
- checkPart1
- checkPart2
Expand All @@ -439,7 +438,6 @@ steps:
- graalvm-ce17
- openjdk17
- openjdk21
- openjdk22
BWC_VERSION: ["7.17.20", "8.13.1", "8.14.0"]
agents:
provider: gcp
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/106503.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 106503
summary: "Support ST_CONTAINS and ST_WITHIN"
area: "ES|QL"
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/106934.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 106934
summary: Adjust array resizing in block builder
area: ES|QL
type: enhancement
issues: []
10 changes: 7 additions & 3 deletions docs/reference/cluster/delete-desired-balance.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

NOTE: {cloud-only}

Resets the desired balance and starts a new computation from the current allocation.
This API may be used if desired balance computation diverged from the current state
and is trying to move too many shards.
Discards the current desired balance and computes a new desired balance starting from the current allocation of shards.
This can sometimes help {es} find a desired balance which needs fewer shard movements to achieve, especially if the
cluster has experienced changes so substantial that the current desired balance is no longer optimal without {es} having
detected that the current desired balance will take more shard movements to achieve than needed. However, this API
imposes a heavy load on the elected master node and may not always have the expected effect. Calling this API should
never be necessary. Consider instead <<shards-rebalancing-heuristics,increasing the value of
`cluster.routing.allocation.balance.threshold`>> to avoid excessive shard movements.

[[delete-desired-balance-request]]
==== {api-request-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The <<esql-stats-by>> function supports these aggregate functions:
* <<esql-agg-median-absolute-deviation>>
* <<esql-agg-min>>
* <<esql-agg-percentile>>
* <<esql-agg-st-centroid>>
* experimental:[] <<esql-agg-st-centroid>>
* <<esql-agg-sum>>
* <<esql-agg-values>>
// end::agg_list[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.

*Description*

Returns whether the first geometry contains the second geometry.

NOTE: 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.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*Description*

Returns whether the two geometries or geometry columns intersect.

NOTE: 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.
7 changes: 7 additions & 0 deletions docs/reference/esql/functions/description/st_within.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.

*Description*

Returns whether the first geometry is within the second geometry.

NOTE: 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.
13 changes: 13 additions & 0 deletions docs/reference/esql/functions/examples/st_contains.asciidoc
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_contains-airport_city_boundaries]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/spatial_shapes.csv-spec[tag=st_contains-airport_city_boundaries-result]
|===

13 changes: 13 additions & 0 deletions docs/reference/esql/functions/examples/st_intersects.asciidoc
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.csv-spec[tag=st_intersects-airports]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/spatial.csv-spec[tag=st_intersects-airports-result]
|===

13 changes: 13 additions & 0 deletions docs/reference/esql/functions/examples/st_within.asciidoc
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_within-airport_city_boundaries]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/spatial_shapes.csv-spec[tag=st_within-airport_city_boundaries-result]
|===

15 changes: 15 additions & 0 deletions docs/reference/esql/functions/layout/st_contains.asciidoc
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_contains]]
=== `ST_CONTAINS`

*Syntax*

[.text-center]
image::esql/functions/signature/st_contains.svg[Embedded,opts=inline]

include::../parameters/st_contains.asciidoc[]
include::../description/st_contains.asciidoc[]
include::../types/st_contains.asciidoc[]
include::../examples/st_contains.asciidoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ image::esql/functions/signature/st_intersects.svg[Embedded,opts=inline]
include::../parameters/st_intersects.asciidoc[]
include::../description/st_intersects.asciidoc[]
include::../types/st_intersects.asciidoc[]
include::../examples/st_intersects.asciidoc[]
15 changes: 15 additions & 0 deletions docs/reference/esql/functions/layout/st_within.asciidoc
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_within]]
=== `ST_WITHIN`

*Syntax*

[.text-center]
image::esql/functions/signature/st_within.svg[Embedded,opts=inline]

include::../parameters/st_within.asciidoc[]
include::../description/st_within.asciidoc[]
include::../types/st_within.asciidoc[]
include::../examples/st_within.asciidoc[]
7 changes: 7 additions & 0 deletions docs/reference/esql/functions/parameters/st_contains.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*Parameters*

`geomA`::
Geometry column name or variable of geometry type

`geomB`::
Geometry column name or variable of geometry type
7 changes: 7 additions & 0 deletions docs/reference/esql/functions/parameters/st_within.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*Parameters*

`geomA`::
Geometry column name or variable of geometry type

`geomB`::
Geometry column name or variable of geometry type
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/st_contains.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/st_within.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions docs/reference/esql/functions/spatial-functions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
{esql} supports these spatial functions:

// tag::spatial_list[]
* <<esql-st_intersects>>
* <<esql-st_x>>
* <<esql-st_y>>
* experimental:[] <<esql-st_intersects>>
* experimental:[] <<esql-st_contains>>
* experimental:[] <<esql-st_within>>
* experimental:[] <<esql-st_x>>
* experimental:[] <<esql-st_y>>
// end::spatial_list[]

include::st_intersects.asciidoc[]
include::st_contains.asciidoc[]
include::st_within.asciidoc[]
include::st_x.asciidoc[]
include::st_y.asciidoc[]
2 changes: 2 additions & 0 deletions docs/reference/esql/functions/st_centroid.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[[esql-agg-st-centroid]]
=== `ST_CENTROID`

experimental::[]

Calculate the spatial centroid over a field with spatial point geometry type.

[source.merge.styled,esql]
Expand Down
26 changes: 26 additions & 0 deletions docs/reference/esql/functions/st_contains.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[discrete]
[[esql-st_contains]]
=== `ST_CONTAINS`

experimental::[]

*Syntax*

[.text-center]
image::esql/functions/signature/st_contains.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_contains.asciidoc[]
This is the inverse of the `<<esql-st_within,ST_WITHIN>>` function.

include::types/st_contains.asciidoc[]
include::examples/st_contains.asciidoc[]
16 changes: 3 additions & 13 deletions docs/reference/esql/functions/st_intersects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[[esql-st_intersects]]
=== `ST_INTERSECTS`

experimental::[]

*Syntax*

[.text-center]
Expand All @@ -24,17 +26,5 @@ They intersect if they have any point in common, including their interior points
(points along lines or within polygons).
In mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅

*Supported types*

include::types/st_intersects.asciidoc[]

*Example*

[source.merge.styled,esql]
----
include::{esql-specs}/spatial.csv-spec[tag=st_intersects-airports]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/spatial.csv-spec[tag=st_intersects-airports-results]
|===
include::examples/st_intersects.asciidoc[]
26 changes: 26 additions & 0 deletions docs/reference/esql/functions/st_within.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[discrete]
[[esql-st_within]]
=== `ST_WITHIN`

experimental::[]

*Syntax*

[.text-center]
image::esql/functions/signature/st_within.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_within.asciidoc[]
This is the inverse of the `<<esql-st_contains,ST_CONTAINS>>` function.

include::types/st_within.asciidoc[]
include::examples/st_within.asciidoc[]
2 changes: 2 additions & 0 deletions docs/reference/esql/functions/st_x.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[[esql-st_x]]
=== `ST_X`

experimental::[]

*Syntax*

[.text-center]
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/esql/functions/st_y.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[[esql-st_y]]
=== `ST_Y`

experimental::[]

*Syntax*

[.text-center]
Expand Down
16 changes: 16 additions & 0 deletions docs/reference/esql/functions/types/st_contains.asciidoc
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
|===
16 changes: 16 additions & 0 deletions docs/reference/esql/functions/types/st_within.asciidoc
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
|===
Loading

0 comments on commit 55a8f30

Please sign in to comment.