Skip to content

Commit 1c4ee72

Browse files
committed
Fixed failing tests after type resolution simplification
The simplification favoured placing the error on the first parameter, but we'd rather place it on the second.
1 parent ed4b6a3 commit 1c4ee72

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/BinarySpatialFunction.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,11 @@ protected TypeResolution resolveType(
192192
}
193193
TypeResolution resolution = isSameSpatialType(spatialExpression.dataType(), otherExpression, sourceText(), otherParamOrdinal);
194194
// TODO Remove these grid checks once we support geo_shape relation to geoGrid
195-
if (resolution.resolved()) {
196-
if (DataType.isGeoGrid(spatialExpression.dataType())) {
197-
resolution = isGeoPoint(otherExpression, otherParamOrdinal);
198-
}
199-
if (DataType.isGeoGrid(otherExpression.dataType())) {
200-
resolution = isGeoPoint(spatialExpression, otherParamOrdinal == FIRST ? SECOND : FIRST);
201-
}
195+
if (resolution.resolved() && DataType.isGeoGrid(spatialExpression.dataType())) {
196+
resolution = isGeoPoint(otherExpression, otherParamOrdinal);
197+
}
198+
if (resolution.resolved() && DataType.isGeoGrid(otherExpression.dataType())) {
199+
resolution = isGeoPoint(spatialExpression, otherParamOrdinal == FIRST ? SECOND : FIRST);
202200
}
203201
if (resolution.unresolved()) {
204202
return resolution;

0 commit comments

Comments
 (0)