mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
fix: case sensitive for __field__ matcher (#4822)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -805,10 +805,11 @@ impl PromPlanner {
|
||||
|
||||
let exprs = result_set
|
||||
.into_iter()
|
||||
.map(|col| DfExpr::Column(col.into()))
|
||||
.map(|col| DfExpr::Column(Column::new_unqualified(col)))
|
||||
.chain(self.create_tag_column_exprs()?)
|
||||
.chain(Some(self.create_time_index_column_expr()?))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// reuse this variable for simplicity
|
||||
table_scan = LogicalPlanBuilder::from(table_scan)
|
||||
.project(exprs)
|
||||
|
||||
@@ -123,3 +123,30 @@ DROP TABLE test;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
CREATE TABLE test (`Field_I` DOUBLE, `Ts_J` TIMESTAMP TIME INDEX, `Tag_K` STRING PRIMARY KEY);
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");
|
||||
|
||||
Affected Rows: 3
|
||||
|
||||
TQL EVAL (0, 10, '5s') test{__field__="Field_I"};
|
||||
|
||||
+---------+-------+---------------------+
|
||||
| Field_I | Tag_K | Ts_J |
|
||||
+---------+-------+---------------------+
|
||||
| 2.0 | a | 1970-01-01T00:00:05 |
|
||||
| 2.0 | a | 1970-01-01T00:00:10 |
|
||||
| 1.0 | b | 1970-01-01T00:00:05 |
|
||||
| 1.0 | b | 1970-01-01T00:00:10 |
|
||||
+---------+-------+---------------------+
|
||||
|
||||
TQL EVAL (0, 10, '5s') test{__field__="field_i"};
|
||||
|
||||
Error: 1004(InvalidArguments), Cannot find column field_i
|
||||
|
||||
drop table test;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
|
||||
@@ -32,3 +32,13 @@ TQL EVAL ('1970-01-01T00:00:00'::timestamp, '1970-01-01T00:00:00'::timestamp + '
|
||||
TQL EVAL (now() - now(), now() - (now() - '10 seconds'::interval), '1s') test{k="a"};
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
CREATE TABLE test (`Field_I` DOUBLE, `Ts_J` TIMESTAMP TIME INDEX, `Tag_K` STRING PRIMARY KEY);
|
||||
|
||||
INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");
|
||||
|
||||
TQL EVAL (0, 10, '5s') test{__field__="Field_I"};
|
||||
|
||||
TQL EVAL (0, 10, '5s') test{__field__="field_i"};
|
||||
|
||||
drop table test;
|
||||
|
||||
Reference in New Issue
Block a user