mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-09 14:52:58 +00:00
* check partition for aggr plan Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * handle empty partition rule Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove CheckPartition option Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add test Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update some valid sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * opt-out promql plan and update sqlness Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix limit Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix insert select subquery Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update unit test result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix typo Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * Update src/query/src/dist_plan/analyzer.rs Co-authored-by: Yingwen <realevenyag@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Yingwen <realevenyag@gmail.com>
70 lines
3.9 KiB
Plaintext
70 lines
3.9 KiB
Plaintext
CREATE TABLE test(i DOUBLE, j TIMESTAMP TIME INDEX, k STRING PRIMARY KEY);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- insert two points at 1ms and one point at 2ms
|
|
INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");
|
|
|
|
Affected Rows: 3
|
|
|
|
-- explain at 0s, 5s and 10s. No point at 0s.
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
TQL EXPLAIN (0, 10, '5s') test;
|
|
|
|
+---------------+-----------------------------------------------------------------------------------------------+
|
|
| plan_type | plan |
|
|
+---------------+-----------------------------------------------------------------------------------------------+
|
|
| logical_plan | PromInstantManipulate: range=[0..0], lookback=[300000], interval=[300000], time index=[j] |
|
|
| | PromSeriesNormalize: offset=[0], time index=[j], filter NaN: [false] |
|
|
| | PromSeriesDivide: tags=["k"] |
|
|
| | MergeScan [is_placeholder=false] |
|
|
| physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j] |
|
|
| | RepartitionExec: partitioning=REDACTED
|
|
| | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] |
|
|
| | PromSeriesDivideExec: tags=["k"] |
|
|
| | SortExec: expr=[k@2 ASC NULLS LAST] |
|
|
| | MergeScanExec: REDACTED
|
|
| | |
|
|
+---------------+-----------------------------------------------------------------------------------------------+
|
|
|
|
DROP TABLE test;
|
|
|
|
Affected Rows: 0
|
|
|
|
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 (peers.*) 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"] |
|
|
| | MergeScan [is_placeholder=false] |
|
|
| physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[ts] |
|
|
| | RepartitionExec: partitioning=REDACTED
|
|
| | PromSeriesNormalizeExec: offset=[0], time index=[ts], filter NaN: [false] |
|
|
| | PromSeriesDivideExec: tags=["collector", "host"] |
|
|
| | SortExec: expr=[collector@1 ASC NULLS LAST,host@2 ASC NULLS LAST] |
|
|
| | MergeScanExec: REDACTED
|
|
| | |
|
|
+---------------+------------------------------------------------------------------------------------------------+
|
|
|
|
DROP TABLE host_load1;
|
|
|
|
Affected Rows: 0
|
|
|