From 8afc0e31805f4de9a14aa9ee87bfd2048c50c363 Mon Sep 17 00:00:00 2001 From: qyaaaa <67301054+qyaaaa@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:18:05 +0800 Subject: [PATCH] bugfix timestamp is null (#1246) --- .../hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java index caeb99fe732..73b9305f3c5 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java @@ -258,6 +258,10 @@ public Map> getHistoryMetricData(Long monitorId, String app, ResultSet resultSet = statement.executeQuery(selectSql); while (resultSet.next()) { Timestamp ts = resultSet.getTimestamp(1); + if (ts == null) { + log.error("warehouse tdengine query result timestamp is null, ignore. {}.", selectSql); + continue; + } String instanceValue = resultSet.getString(2); if (instanceValue == null || "".equals(instanceValue)) { instanceValue = "";