mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
fix: __field__ matcher on single value column (#1805)
* fix error text and field_column_names Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add sqlness test Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add empty line Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * improve style Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -31,3 +31,41 @@ DROP TABLE test;
|
||||
|
||||
Affected Rows: 1
|
||||
|
||||
CREATE TABLE host_load1 (
|
||||
ts TIMESTAMP(3) NOT NULL,
|
||||
collector STRING NULL,
|
||||
host STRING NULL,
|
||||
val DOUBLE NULL,
|
||||
TIME INDEX (ts),
|
||||
PRIMARY KEY (collector, host)
|
||||
);
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
||||
-- SQLNESS REPLACE (peer-.*) REDACTED
|
||||
TQL EXPLAIN host_load1{__field__="val"};
|
||||
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| plan_type | plan |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| logical_plan | PromInstantManipulate: range=[0..0], lookback=[300000], interval=[300000], time index=[ts] |
|
||||
| | PromSeriesNormalize: offset=[0], time index=[ts], filter NaN: [false] |
|
||||
| | PromSeriesDivide: tags=["collector", "host"] |
|
||||
| | Sort: host_load1.collector DESC NULLS LAST, host_load1.host DESC NULLS LAST, host_load1.ts DESC NULLS LAST |
|
||||
| | Projection: host_load1.val, host_load1.collector, host_load1.host, host_load1.ts |
|
||||
| | MergeScan [is_placeholder=false] |
|
||||
| | TableScan: host_load1 projection=[ts, collector, host, val], partial_filters=[ts >= TimestampMillisecond(-300000, None), ts <= TimestampMillisecond(300000, None)] |
|
||||
| physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[ts] |
|
||||
| | PromSeriesNormalizeExec: offset=[0], time index=[ts], filter NaN: [false] |
|
||||
| | PromSeriesDivideExec: tags=["collector", "host"] |
|
||||
| | RepartitionExec: partitioning=REDACTED
|
||||
| | ProjectionExec: expr=[val@3 as val, collector@1 as collector, host@2 as host, ts@0 as ts] |
|
||||
| | MergeScanExec: peers=[REDACTED
|
||||
| | |
|
||||
+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
DROP TABLE host_load1;
|
||||
|
||||
Affected Rows: 1
|
||||
|
||||
|
||||
@@ -9,3 +9,18 @@ INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");
|
||||
TQL EXPLAIN (0, 10, '5s') test;
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
CREATE TABLE host_load1 (
|
||||
ts TIMESTAMP(3) NOT NULL,
|
||||
collector STRING NULL,
|
||||
host STRING NULL,
|
||||
val DOUBLE NULL,
|
||||
TIME INDEX (ts),
|
||||
PRIMARY KEY (collector, host)
|
||||
);
|
||||
|
||||
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
||||
-- SQLNESS REPLACE (peer-.*) REDACTED
|
||||
TQL EXPLAIN host_load1{__field__="val"};
|
||||
|
||||
DROP TABLE host_load1;
|
||||
|
||||
Reference in New Issue
Block a user