mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 16:00:38 +00:00
fix: remove metric engine's internal column from promql's query (#5032)
* fix: remove metric engine's internal column from promql's query Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove unwrap Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * filter out physical table Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add integration test Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -63,6 +63,9 @@ use promql_parser::parser::{
|
||||
VectorMatchCardinality, VectorSelector,
|
||||
};
|
||||
use snafu::{ensure, OptionExt, ResultExt};
|
||||
use store_api::metric_engine_consts::{
|
||||
DATA_SCHEMA_TABLE_ID_COLUMN_NAME, DATA_SCHEMA_TSID_COLUMN_NAME,
|
||||
};
|
||||
use table::table::adapter::DfTableProviderAdapter;
|
||||
|
||||
use crate::promql::error::{
|
||||
@@ -1146,6 +1149,10 @@ impl PromPlanner {
|
||||
.table_info()
|
||||
.meta
|
||||
.row_key_column_names()
|
||||
.filter(|col| {
|
||||
// remove metric engine's internal columns
|
||||
col != &DATA_SCHEMA_TABLE_ID_COLUMN_NAME && col != &DATA_SCHEMA_TSID_COLUMN_NAME
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
self.ctx.tag_columns = tags;
|
||||
|
||||
Reference in New Issue
Block a user