diff --git a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java index 63f3e27830fa..58d9fbfbdf8a 100644 --- a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java +++ b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java @@ -179,8 +179,8 @@ private static Object valueMapper(CsvTestUtils.Type type, Object value) { if (value == null) { return "null"; } - if (type == CsvTestUtils.Type.GEO_POINT) { - // GeoPoint tests are failing in clustered integration tests because of tiny precision differences at very small scales + if (type == CsvTestUtils.Type.GEO_POINT || type == CsvTestUtils.Type.CARTESIAN_POINT) { + // Point tests are failing in clustered integration tests because of tiny precision differences at very small scales if (value instanceof GeoPoint point) { return normalizedGeoPoint(point.getX(), point.getY()); } @@ -188,7 +188,7 @@ private static Object valueMapper(CsvTestUtils.Type type, Object value) { try { Geometry geometry = WellKnownText.fromWKT(GeometryValidator.NOOP, false, wkt); if (geometry instanceof Point point) { - return normalizedGeoPoint(point.getX(), point.getY()); + return normalizedPoint(type, point.getX(), point.getY()); } } catch (Throwable ignored) {} } @@ -196,6 +196,13 @@ private static Object valueMapper(CsvTestUtils.Type type, Object value) { return value.toString(); } + private static String normalizedPoint(CsvTestUtils.Type type, double x, double y) { + if (type == CsvTestUtils.Type.GEO_POINT) { + return normalizedGeoPoint(x, y); + } + return String.format(Locale.ROOT, "POINT (%f %f)", (float) x, (float) y); + } + private static String normalizedGeoPoint(double x, double y) { x = decodeLongitude(encodeLongitude(x)); y = decodeLatitude(encodeLatitude(y));