Skip to content

Commit

Permalink
[querier] Fix app_label filter
Browse files Browse the repository at this point in the history
- run automation test(querier_sql) pass
  • Loading branch information
xiaochaoren1 committed Aug 21, 2023
1 parent 4663bbf commit 0728c86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/querier/engine/clickhouse/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,11 @@ func GetRemoteReadFilter(promTag, table, op, value, originFilter string, e *CHEn
valueIDs = append(valueIDs, valueIDString)
}
valueIDFilter := strings.Join(valueIDs, ",")
filter = fmt.Sprintf("app_label_value_id_%d IN (%s)", appLabel.appLabelColumnIndex, valueIDFilter)
if valueIDFilter == "" {
filter = "1!=1"
} else {
filter = fmt.Sprintf("app_label_value_id_%d IN (%s)", appLabel.appLabelColumnIndex, valueIDFilter)
}
entryValue := common.EntryValue{Time: time.Now(), Filter: filter}
prometheusSubqueryCache.PrometheusSubqueryCache.Add(originFilter, entryValue)
return filter, nil
Expand Down

0 comments on commit 0728c86

Please sign in to comment.