From a58aae16c0311e45a69c0a50fb61d732d7383982 Mon Sep 17 00:00:00 2001 From: impress <56623162+QZmp236478@users.noreply.github.com> Date: Wed, 17 May 2023 22:26:21 +0800 Subject: [PATCH] bugfix TDengine missing first TS parameter (#964) Signed-off-by: impress <56623162+QZmp236478@users.noreply.github.com> --- .../hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 42542590c6e..344277fbd13 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 @@ -59,7 +59,7 @@ public class HistoryTdEngineDataStorage extends AbstractHistoryDataStorage { private static final String QUERY_HISTORY_SQL = "SELECT ts, instance, `%s` FROM %s WHERE ts >= now - %s order by ts desc"; private static final String QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL - = "SELECT first(`%s`), avg(`%s`), min(`%s`), max(`%s`) FROM %s WHERE instance = %s AND ts >= now - %s interval(4h)"; + = "SELECT first(`ts`), first(`%s`), avg(`%s`), min(`%s`), max(`%s`) FROM %s WHERE instance = %s AND ts >= now - %s interval(4h)"; private static final String QUERY_INSTANCE_SQL = "SELECT DISTINCT instance FROM %s WHERE ts >= now - 1w";