fix: http and tql should return the same value for nuknown (#6718)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong
2025-08-12 14:38:01 +08:00
committed by GitHub
parent d2d6489b2f
commit 5cec0d4e3a

View File

@@ -185,6 +185,14 @@ impl PrometheusJsonResponse {
metric_name: Option<String>,
result_type: ValueType,
) -> Result<PrometheusResponse> {
// Return empty result if no batches
if batches.iter().next().is_none() {
return Ok(PrometheusResponse::PromData(PromData {
result_type: result_type.to_string(),
..Default::default()
}));
}
// infer semantic type of each column from schema.
// TODO(ruihang): wish there is a better way to do this.
let mut timestamp_column_index = None;