mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-27 18:30:38 +00:00
* fix: specify input ordering and distribution for prom plan Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
34 lines
7.2 KiB
Plaintext
34 lines
7.2 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
|
|
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"] |
|
|
| | Sort: test.k DESC NULLS LAST, test.j DESC NULLS LAST |
|
|
| | TableScan: test projection=[i, j, k], partial_filters=[j >= TimestampMillisecond(-300000, None), j <= TimestampMillisecond(300000, None)] |
|
|
| physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j] |
|
|
| | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] |
|
|
| | PromSeriesDivideExec: tags=["k"] |
|
|
| | SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] |
|
|
| | StreamScanAdapter { stream: "<SendableRecordBatchStream>", schema: [Field { name: "i", data_type: Float64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "j", data_type: Timestamp(Millisecond, None), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {"greptime:time_index": "true"} }, Field { name: "k", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }] } |
|
|
| | |
|
|
+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
DROP TABLE test;
|
|
|
|
Affected Rows: 1
|
|
|