From 029f912783c9d386d6bd75d0e0f3eaaddcb42446 Mon Sep 17 00:00:00 2001 From: htlee Date: Thu, 19 Feb 2026 19:00:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=95=B4=EA=B5=AC=20=ED=86=B5=EA=B3=84?= =?UTF-8?q?=20ROUND=20=ED=95=A8=EC=88=98=20=ED=83=80=EC=9E=85=20=EC=BA=90?= =?UTF-8?q?=EC=8A=A4=ED=8C=85=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GREATEST() 반환값이 double precision이라 ROUND(dp, int) 호출 시 PostgreSQL에서 미지원 함수 에러 발생 → 전체 나눗셈 결과를 ::numeric 캐스팅 Co-Authored-By: Claude Opus 4.6 --- .../monitoring/controller/MonitoringController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gc/mda/signal_batch/monitoring/controller/MonitoringController.java b/src/main/java/gc/mda/signal_batch/monitoring/controller/MonitoringController.java index ac7482a..dcc29b0 100644 --- a/src/main/java/gc/mda/signal_batch/monitoring/controller/MonitoringController.java +++ b/src/main/java/gc/mda/signal_batch/monitoring/controller/MonitoringController.java @@ -93,8 +93,8 @@ public class MonitoringController { CONCAT('대해구 ', h.haegu_no) as haegu_name, COUNT(DISTINCT a.mmsi) as current_vessels, ROUND(AVG(a.sog)::numeric, 1) as avg_speed, - ROUND(COUNT(DISTINCT a.mmsi)::numeric / - GREATEST((h.max_lat - h.min_lat) * (h.max_lon - h.min_lon) * 12321, 0.01), + ROUND((COUNT(DISTINCT a.mmsi)::numeric / + GREATEST((h.max_lat - h.min_lat) * (h.max_lon - h.min_lon) * 12321, 0.01))::numeric, 4) as avg_density, MAX(a.last_update) as last_update, h.center_lon,