Skip to content

Commit

Permalink
bugfix HistoryTdEngineDataStorage sql (#1019)
Browse files Browse the repository at this point in the history
Signed-off-by: impress <56623162+QZmp236478@users.noreply.github.com>
  • Loading branch information
QZmp236478 authored Jun 11, 2023
1 parent 2be6401 commit 9bc06e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public class HistoryTdEngineDataStorage extends AbstractHistoryDataStorage {
private static final String CREATE_SUPER_TABLE_SQL = "CREATE STABLE IF NOT EXISTS `%s` %s TAGS (monitor BIGINT)";
private static final String NO_SUPER_TABLE_ERROR = "Table does not exist";
private static final String QUERY_HISTORY_WITH_INSTANCE_SQL
= "SELECT ts, instance, `%s` FROM %s WHERE instance = %s AND ts >= now - %s order by ts desc";
= "SELECT ts, instance, `%s` FROM %s WHERE instance = '%s' AND ts >= now - %s order by ts desc";
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(`ts`), 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";

Expand Down

0 comments on commit 9bc06e3

Please sign in to comment.