From f86235576fc7eed6669ebbecaea5bd984c62b48c Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Wed, 13 Sep 2023 04:07:55 -0500 Subject: [PATCH] fix: update sqlness result in distributed mode (#2381) Signed-off-by: Ruihang Xia --- .../distributed/explain/join_10_tables.result | 22 ++--- .../distributed/explain/join_10_tables.sql | 2 +- .../explain/multi_partitions.result | 4 +- .../distributed/explain/multi_partitions.sql | 2 +- .../cases/distributed/explain/order_by.result | 12 +-- tests/cases/distributed/explain/order_by.sql | 6 +- .../explain/single_partition.result | 12 +-- .../distributed/explain/single_partition.sql | 6 +- .../distributed/explain/subqueries.result | 18 ++-- .../cases/distributed/explain/subqueries.sql | 6 +- .../distributed/optimizer/order_by.result | 99 ++++++++++--------- .../cases/distributed/optimizer/order_by.sql | 5 + .../tql-explain-analyze/analyze.result | 4 +- .../tql-explain-analyze/analyze.sql | 2 +- .../tql-explain-analyze/explain.result | 8 +- .../tql-explain-analyze/explain.sql | 4 +- 16 files changed, 111 insertions(+), 101 deletions(-) diff --git a/tests/cases/distributed/explain/join_10_tables.result b/tests/cases/distributed/explain/join_10_tables.result index 23ba1f31fec6..a354a2cc6797 100644 --- a/tests/cases/distributed/explain/join_10_tables.result +++ b/tests/cases/distributed/explain/join_10_tables.result @@ -42,7 +42,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from @@ -122,45 +122,45 @@ limit 1; |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_FilterExec: vin@1 IS NOT NULL_| |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_FilterExec: vin@1 IS NOT NULL_| |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/join_10_tables.sql b/tests/cases/distributed/explain/join_10_tables.sql index 6f756ade6bb1..bab730910e96 100644 --- a/tests/cases/distributed/explain/join_10_tables.sql +++ b/tests/cases/distributed/explain/join_10_tables.sql @@ -13,7 +13,7 @@ create table t_10 (ts timestamp time index, vin string, val int); -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from diff --git a/tests/cases/distributed/explain/multi_partitions.result b/tests/cases/distributed/explain/multi_partitions.result index d15882b5bbdd..3eb7b5491b95 100644 --- a/tests/cases/distributed/explain/multi_partitions.result +++ b/tests/cases/distributed/explain/multi_partitions.result @@ -19,7 +19,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain SELECT * FROM demo WHERE ts > cast(1000000000 as timestamp) ORDER BY host; +-+-+ @@ -28,7 +28,7 @@ explain SELECT * FROM demo WHERE ts > cast(1000000000 as timestamp) ORDER BY hos | logical_plan_| Sort: demo.host ASC NULLS LAST_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortExec: expr=[host@0 ASC NULLS LAST]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/multi_partitions.sql b/tests/cases/distributed/explain/multi_partitions.sql index e3fa3f679177..7f35c5ad0d7a 100644 --- a/tests/cases/distributed/explain/multi_partitions.sql +++ b/tests/cases/distributed/explain/multi_partitions.sql @@ -17,7 +17,7 @@ PARTITION BY RANGE COLUMNS (host) ( -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain SELECT * FROM demo WHERE ts > cast(1000000000 as timestamp) ORDER BY host; drop table demo; diff --git a/tests/cases/distributed/explain/order_by.result b/tests/cases/distributed/explain/order_by.result index c62895a4d096..0501a35da0ec 100644 --- a/tests/cases/distributed/explain/order_by.result +++ b/tests/cases/distributed/explain/order_by.result @@ -6,7 +6,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT DISTINCT i%2 FROM integers ORDER BY 1; +-+-+ @@ -22,7 +22,7 @@ EXPLAIN SELECT DISTINCT i%2 FROM integers ORDER BY 1; |_|_RepartitionExec: partitioning=REDACTED |_|_AggregateExec: mode=Partial, gby=[integers.i % Int64(2)@0 as integers.i % Int64(2)], aggr=[]_| |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -38,7 +38,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT a, b FROM test ORDER BY a, b; +-+-+ @@ -47,7 +47,7 @@ EXPLAIN SELECT a, b FROM test ORDER BY a, b; | logical_plan_| Sort: test.a ASC NULLS LAST, test.b ASC NULLS LAST_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortExec: expr=[a@0 ASC NULLS LAST,b@1 ASC NULLS LAST] | -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -55,7 +55,7 @@ EXPLAIN SELECT a, b FROM test ORDER BY a, b; -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT DISTINCT a, b FROM test ORDER BY a, b; +-+-+ @@ -71,7 +71,7 @@ EXPLAIN SELECT DISTINCT a, b FROM test ORDER BY a, b; |_|_RepartitionExec: partitioning=REDACTED |_|_AggregateExec: mode=Partial, gby=[a@0 as a, b@1 as b], aggr=[]_| |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/order_by.sql b/tests/cases/distributed/explain/order_by.sql index 6227866653bf..39ad15bbb1a6 100644 --- a/tests/cases/distributed/explain/order_by.sql +++ b/tests/cases/distributed/explain/order_by.sql @@ -4,7 +4,7 @@ CREATE TABLE integers(i BIGINT, ts TIMESTAMP TIME INDEX); -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT DISTINCT i%2 FROM integers ORDER BY 1; DROP TABLE integers; @@ -16,14 +16,14 @@ CREATE TABLE test (a INTEGER, b INTEGER, t TIMESTAMP TIME INDEX); -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT a, b FROM test ORDER BY a, b; -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT DISTINCT a, b FROM test ORDER BY a, b; DROP TABLE test; diff --git a/tests/cases/distributed/explain/single_partition.result b/tests/cases/distributed/explain/single_partition.result index 14aaa55c0a3f..581e62b4dabf 100644 --- a/tests/cases/distributed/explain/single_partition.result +++ b/tests/cases/distributed/explain/single_partition.result @@ -6,7 +6,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT COUNT(*) FROM single_partition; +-+-+ @@ -20,7 +20,7 @@ EXPLAIN SELECT COUNT(*) FROM single_partition; |_|_AggregateExec: mode=Partial, gby=[], aggr=[COUNT(UInt8(1))]_| |_|_RepartitionExec: partitioning=REDACTED |_|_ProjectionExec: expr=[]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -28,7 +28,7 @@ EXPLAIN SELECT COUNT(*) FROM single_partition; -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT SUM(i) FROM single_partition; +-+-+ @@ -42,7 +42,7 @@ EXPLAIN SELECT SUM(i) FROM single_partition; |_|_AggregateExec: mode=Partial, gby=[], aggr=[SUM(single_partition.i)]_| |_|_RepartitionExec: partitioning=REDACTED |_|_ProjectionExec: expr=[i@0 as i]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -50,7 +50,7 @@ EXPLAIN SELECT SUM(i) FROM single_partition; -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM single_partition ORDER BY i DESC; +-+-+ @@ -59,7 +59,7 @@ EXPLAIN SELECT * FROM single_partition ORDER BY i DESC; | logical_plan_| Sort: single_partition.i DESC NULLS FIRST_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortExec: expr=[i@0 DESC]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/single_partition.sql b/tests/cases/distributed/explain/single_partition.sql index 9036d824427b..78203a3c2d73 100644 --- a/tests/cases/distributed/explain/single_partition.sql +++ b/tests/cases/distributed/explain/single_partition.sql @@ -4,21 +4,21 @@ CREATE TABLE single_partition(i DOUBLE, j TIMESTAMP TIME INDEX, k STRING PRIMARY -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT COUNT(*) FROM single_partition; -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT SUM(i) FROM single_partition; -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM single_partition ORDER BY i DESC; drop table single_partition; diff --git a/tests/cases/distributed/explain/subqueries.result b/tests/cases/distributed/explain/subqueries.result index ad2b369f5323..ba5c162e2692 100644 --- a/tests/cases/distributed/explain/subqueries.result +++ b/tests/cases/distributed/explain/subqueries.result @@ -6,7 +6,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i; +-+-+ @@ -24,11 +24,11 @@ EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i; |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -36,7 +36,7 @@ EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i; -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1.i) ORDER BY i1.i; +-+-+ @@ -56,12 +56,12 @@ EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1 |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED |_|_RepartitionExec: partitioning=REDACTED |_|_ProjectionExec: expr=[i@0 as i]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ @@ -73,7 +73,7 @@ Affected Rows: 0 -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain select t.i from ( select * from integers join other on 1=1 @@ -95,13 +95,13 @@ order by t.i desc; | physical_plan | SortExec: expr=[i@0 DESC]_| |_|_NestedLoopJoinExec: join_type=Inner_| |_|_ProjectionExec: expr=[]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_CoalescePartitionsExec_| |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_FilterExec: i@0 IS NOT NULL_| |_|_RepartitionExec: partitioning=REDACTED |_|_ProjectionExec: expr=[i@0 as i]_| -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/subqueries.sql b/tests/cases/distributed/explain/subqueries.sql index 1dac060f693e..deeb9cf28377 100644 --- a/tests/cases/distributed/explain/subqueries.sql +++ b/tests/cases/distributed/explain/subqueries.sql @@ -4,14 +4,14 @@ CREATE TABLE integers(i INTEGER, j TIMESTAMP TIME INDEX); -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i; -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1.i) ORDER BY i1.i; create table other (i INTEGER, j TIMESTAMP TIME INDEX); @@ -20,7 +20,7 @@ create table other (i INTEGER, j TIMESTAMP TIME INDEX); -- SQLNESS REPLACE (\s\s+) _ -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (Hash.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED explain select t.i from ( select * from integers join other on 1=1 diff --git a/tests/cases/distributed/optimizer/order_by.result b/tests/cases/distributed/optimizer/order_by.result index c1d5b7171a73..16712a58c9e4 100644 --- a/tests/cases/distributed/optimizer/order_by.result +++ b/tests/cases/distributed/optimizer/order_by.result @@ -1,62 +1,67 @@ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers; -+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| plan_type | plan | -+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | StreamScanAdapter { stream: "", schema: [Field { name: "number", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }] } | -| | | -+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------+-------------------------------------------+ +| plan_type | plan | ++---------------+-------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | MergeScanExec: REDACTED +| | | ++---------------+-------------------------------------------+ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc; -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| plan_type | plan | -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| logical_plan | Sort: numbers.number DESC NULLS FIRST | -| | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 DESC] | -| | StreamScanAdapter { stream: "", schema: [Field { name: "number", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }] } | -| | | -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------+---------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------+ +| logical_plan | Sort: numbers.number DESC NULLS FIRST | +| | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 DESC] | +| | MergeScanExec: REDACTED +| | | ++---------------+---------------------------------------------+ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc; -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| plan_type | plan | -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| logical_plan | Sort: numbers.number ASC NULLS LAST | -| | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST] | -| | StreamScanAdapter { stream: "", schema: [Field { name: "number", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }] } | -| | | -+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------+---------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------+ +| logical_plan | Sort: numbers.number ASC NULLS LAST | +| | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST] | +| | MergeScanExec: REDACTED +| | | ++---------------+---------------------------------------------+ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc limit 10; -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| logical_plan | Limit: skip=0, fetch=10 | -| | Sort: numbers.number DESC NULLS FIRST, fetch=10 | -| | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: fetch=10, expr=[number@0 DESC] | -| | StreamScanAdapter { stream: "", schema: [Field { name: "number", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }] } | -| | | -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------+---------------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------------+ +| logical_plan | Limit: skip=0, fetch=10 | +| | Sort: numbers.number DESC NULLS FIRST, fetch=10 | +| | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: fetch=10, expr=[number@0 DESC] | +| | MergeScanExec: REDACTED +| | | ++---------------+---------------------------------------------------+ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc limit 10; -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| logical_plan | Limit: skip=0, fetch=10 | -| | Sort: numbers.number ASC NULLS LAST, fetch=10 | -| | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: fetch=10, expr=[number@0 ASC NULLS LAST] | -| | StreamScanAdapter { stream: "", schema: [Field { name: "number", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }] } | -| | | -+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------+------------------------------------------------------+ +| plan_type | plan | ++---------------+------------------------------------------------------+ +| logical_plan | Limit: skip=0, fetch=10 | +| | Sort: numbers.number ASC NULLS LAST, fetch=10 | +| | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: fetch=10, expr=[number@0 ASC NULLS LAST] | +| | MergeScanExec: REDACTED +| | | ++---------------+------------------------------------------------------+ diff --git a/tests/cases/distributed/optimizer/order_by.sql b/tests/cases/distributed/optimizer/order_by.sql index eb8bf6e5f0f6..d616d2b222b4 100644 --- a/tests/cases/distributed/optimizer/order_by.sql +++ b/tests/cases/distributed/optimizer/order_by.sql @@ -1,9 +1,14 @@ +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers; +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc; +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc; +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc limit 10; +-- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc limit 10; diff --git a/tests/cases/distributed/tql-explain-analyze/analyze.result b/tests/cases/distributed/tql-explain-analyze/analyze.result index c8e8a785f964..32bb5223d6c9 100644 --- a/tests/cases/distributed/tql-explain-analyze/analyze.result +++ b/tests/cases/distributed/tql-explain-analyze/analyze.result @@ -12,7 +12,7 @@ Affected Rows: 3 -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL ANALYZE (0, 10, '5s') test; +-+-+ @@ -23,7 +23,7 @@ TQL ANALYZE (0, 10, '5s') test; |_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false], REDACTED |_|_PromSeriesDivideExec: tags=["k"], REDACTED |_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST], REDACTED -|_|_MergeScanExec: peers=[REDACTED +|_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/tql-explain-analyze/analyze.sql b/tests/cases/distributed/tql-explain-analyze/analyze.sql index 054471843683..e9e01bfb091c 100644 --- a/tests/cases/distributed/tql-explain-analyze/analyze.sql +++ b/tests/cases/distributed/tql-explain-analyze/analyze.sql @@ -8,7 +8,7 @@ INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a"); -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (-+) - -- SQLNESS REPLACE (\s\s+) _ --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL ANALYZE (0, 10, '5s') test; DROP TABLE test; diff --git a/tests/cases/distributed/tql-explain-analyze/explain.result b/tests/cases/distributed/tql-explain-analyze/explain.result index 9c6bf36e3fc3..c6ee88bdf644 100644 --- a/tests/cases/distributed/tql-explain-analyze/explain.result +++ b/tests/cases/distributed/tql-explain-analyze/explain.result @@ -9,7 +9,7 @@ Affected Rows: 3 -- explain at 0s, 5s and 10s. No point at 0s. -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL EXPLAIN (0, 10, '5s') test; +---------------+-----------------------------------------------------------------------------------------------+ @@ -24,7 +24,7 @@ TQL EXPLAIN (0, 10, '5s') test; | | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] | | | PromSeriesDivideExec: tags=["k"] | | | SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] | -| | MergeScanExec: peers=[REDACTED +| | MergeScanExec: REDACTED | | | +---------------+-----------------------------------------------------------------------------------------------+ @@ -44,7 +44,7 @@ CREATE TABLE host_load1 ( Affected Rows: 0 -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL EXPLAIN host_load1{__field__="val"}; +---------------+------------------------------------------------------------------------------------------------------------------+ @@ -59,7 +59,7 @@ TQL EXPLAIN host_load1{__field__="val"}; | | PromSeriesNormalizeExec: offset=[0], time index=[ts], filter NaN: [false] | | | PromSeriesDivideExec: tags=["collector", "host"] | | | SortExec: expr=[collector@1 DESC NULLS LAST,host@2 DESC NULLS LAST,ts@3 DESC NULLS LAST] | -| | MergeScanExec: peers=[REDACTED +| | MergeScanExec: REDACTED | | | +---------------+------------------------------------------------------------------------------------------------------------------+ diff --git a/tests/cases/distributed/tql-explain-analyze/explain.sql b/tests/cases/distributed/tql-explain-analyze/explain.sql index d0f237d0aaf2..f9316ece3432 100644 --- a/tests/cases/distributed/tql-explain-analyze/explain.sql +++ b/tests/cases/distributed/tql-explain-analyze/explain.sql @@ -5,7 +5,7 @@ INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a"); -- explain at 0s, 5s and 10s. No point at 0s. -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL EXPLAIN (0, 10, '5s') test; DROP TABLE test; @@ -20,7 +20,7 @@ CREATE TABLE host_load1 ( ); -- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED --- SQLNESS REPLACE (peer-.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED TQL EXPLAIN host_load1{__field__="val"}; DROP TABLE host_load1;