fix: reset tags when creating an empty metric in prom call (#6056)

* Revert "chore: remove debug logs"

This reverts commit f73f3a7373c83db974d8ed80cb47f5f87317b490.

* chore: more logs

* fix: reset tags and fields

* test: add binary time fn test

* chore: remove logs

* test: sort result
This commit is contained in:
Yingwen
2025-05-07 16:08:51 +08:00
committed by Zhenchi
parent d596dba240
commit 1ca2dbd240
3 changed files with 113 additions and 0 deletions

View File

@@ -761,6 +761,8 @@ impl PromPlanner {
} else {
self.ctx.time_index_column = Some(SPECIAL_TIME_FUNCTION.to_string());
self.ctx.reset_table_name_and_schema();
self.ctx.tag_columns = vec![];
self.ctx.field_columns = vec![DEFAULT_FIELD_COLUMN.to_string()];
LogicalPlan::Extension(Extension {
node: Arc::new(
EmptyMetric::new(
@@ -2828,6 +2830,7 @@ impl PromPlanner {
let project_fields = non_field_columns_iter
.chain(field_columns_iter)
.collect::<Result<Vec<_>>>()?;
LogicalPlanBuilder::from(input)
.project(project_fields)
.context(DataFusionPlanningSnafu)?