From 8a07dbf605947663c8aca471099385bd391f82c0 Mon Sep 17 00:00:00 2001 From: Alan Tang Date: Wed, 31 Dec 2025 12:55:22 +0800 Subject: [PATCH] fix: fix sqlness test error about double precision (#7476) * fix: fix sqlness test error about double precision Signed-off-by: StandingMan * fix: use round method to truncate the result Signed-off-by: StandingMan --------- Signed-off-by: StandingMan --- .../cases/standalone/common/join/join_with_aggregates.result | 4 ++-- tests/cases/standalone/common/join/join_with_aggregates.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cases/standalone/common/join/join_with_aggregates.result b/tests/cases/standalone/common/join/join_with_aggregates.result index 8f5e408038..13aa01356e 100644 --- a/tests/cases/standalone/common/join/join_with_aggregates.result +++ b/tests/cases/standalone/common/join/join_with_aggregates.result @@ -96,7 +96,7 @@ FROM ( s."location", COUNT(DISTINCT s.sensor_id) as sensor_count, COUNT(r.reading_id) / COUNT(DISTINCT s.sensor_id) as avg_readings_per_sensor, - AVG(r."value") as location_avg_value + ROUND(AVG(r."value"), 6) as location_avg_value FROM sensors s INNER JOIN readings r ON s.sensor_id = r.sensor_id GROUP BY s."location" @@ -107,7 +107,7 @@ ORDER BY location_summary.location_avg_value DESC; | location | sensor_count | avg_readings_per_sensor | location_avg_value | +----------+--------------+-------------------------+--------------------+ | Room B | 2 | 2 | 35.88 | -| Room A | 2 | 2 | 31.880000000000003 | +| Room A | 2 | 2 | 31.88 | +----------+--------------+-------------------------+--------------------+ -- Join with aggregated conditions diff --git a/tests/cases/standalone/common/join/join_with_aggregates.sql b/tests/cases/standalone/common/join/join_with_aggregates.sql index ec9a546f62..11761e05c9 100644 --- a/tests/cases/standalone/common/join/join_with_aggregates.sql +++ b/tests/cases/standalone/common/join/join_with_aggregates.sql @@ -62,7 +62,7 @@ FROM ( s."location", COUNT(DISTINCT s.sensor_id) as sensor_count, COUNT(r.reading_id) / COUNT(DISTINCT s.sensor_id) as avg_readings_per_sensor, - AVG(r."value") as location_avg_value + ROUND(AVG(r."value"), 6) as location_avg_value FROM sensors s INNER JOIN readings r ON s.sensor_id = r.sensor_id GROUP BY s."location"