fix: case sensitive for __field__ matcher (#4822)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2024-10-14 11:18:59 +08:00
committed by GitHub
parent 2f2b4b306c
commit a889ea88ca
3 changed files with 39 additions and 1 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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;