|
73 | 73 | }
|
74 | 74 | ]
|
75 | 75 | },
|
| 76 | + { |
| 77 | + "Name": "TestQ9", |
| 78 | + "Cases": [ |
| 79 | + { |
| 80 | + "SQL": "explain format='brief' SELECT nation, o_year, SUM(amount) AS sum_profit FROM (SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_suppkey = l_suppkey AND ps_suppkey = l_suppkey AND ps_partkey = l_partkey AND p_partkey = l_partkey AND o_orderkey = l_orderkey AND s_nationkey = n_nationkey AND p_name LIKE '%dim%') AS profit GROUP BY nation, o_year ORDER BY nation, o_year DESC;", |
| 81 | + "Result": [ |
| 82 | + "Sort 8000.00 root test.nation.n_name, Column#52:desc", |
| 83 | + "└─TableReader 8000.00 root MppVersion: 3, data:ExchangeSender", |
| 84 | + " └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough", |
| 85 | + " └─Projection 8000.00 mpp[tiflash] test.nation.n_name, Column#52, Column#54", |
| 86 | + " └─Projection 8000.00 mpp[tiflash] Column#54, test.nation.n_name, Column#52", |
| 87 | + " └─HashAgg 8000.00 mpp[tiflash] group by:Column#72, test.nation.n_name, funcs:sum(Column#73)->Column#54, funcs:firstrow(test.nation.n_name)->test.nation.n_name, funcs:firstrow(Column#72)->Column#52", |
| 88 | + " └─ExchangeReceiver 8000.00 mpp[tiflash] ", |
| 89 | + " └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.nation.n_name, collate: utf8mb4_bin]", |
| 90 | + " └─HashAgg 8000.00 mpp[tiflash] group by:Column#77, Column#78, funcs:sum(Column#76)->Column#73", |
| 91 | + " └─Projection 24414.06 mpp[tiflash] minus(mul(test.lineitem.l_extendedprice, minus(1, test.lineitem.l_discount)), mul(test.partsupp.ps_supplycost, test.lineitem.l_quantity))->Column#76, test.nation.n_name->Column#77, extract(YEAR, test.orders.o_orderdate)->Column#78", |
| 92 | + " └─Projection 24414.06 mpp[tiflash] test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.partsupp.ps_supplycost, test.orders.o_orderdate, test.nation.n_name", |
| 93 | + " └─Projection 24414.06 mpp[tiflash] test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.partsupp.ps_supplycost, test.orders.o_orderdate, test.nation.n_name, test.supplier.s_nationkey", |
| 94 | + " └─HashJoin 24414.06 mpp[tiflash] inner join, equal:[eq(test.supplier.s_nationkey, test.nation.n_nationkey)]", |
| 95 | + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", |
| 96 | + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.nation.n_nationkey, collate: binary]", |
| 97 | + " │ └─TableFullScan 10000.00 mpp[tiflash] table:nation keep order:false, stats:pseudo", |
| 98 | + " └─ExchangeReceiver(Probe) 19531.25 mpp[tiflash] ", |
| 99 | + " └─ExchangeSender 19531.25 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_nationkey, collate: binary]", |
| 100 | + " └─Projection 19531.25 mpp[tiflash] test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.supplier.s_nationkey, test.partsupp.ps_supplycost, test.orders.o_orderdate, test.lineitem.l_orderkey", |
| 101 | + " └─HashJoin 19531.25 mpp[tiflash] inner join, equal:[eq(test.lineitem.l_orderkey, test.orders.o_orderkey)]", |
| 102 | + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", |
| 103 | + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.orders.o_orderkey, collate: binary]", |
| 104 | + " │ └─TableFullScan 10000.00 mpp[tiflash] table:orders keep order:false, stats:pseudo", |
| 105 | + " └─ExchangeReceiver(Probe) 15625.00 mpp[tiflash] ", |
| 106 | + " └─ExchangeSender 15625.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.lineitem.l_orderkey, collate: binary]", |
| 107 | + " └─Projection 15625.00 mpp[tiflash] test.lineitem.l_orderkey, test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.supplier.s_nationkey, test.partsupp.ps_supplycost, test.lineitem.l_suppkey, test.lineitem.l_partkey", |
| 108 | + " └─HashJoin 15625.00 mpp[tiflash] inner join, equal:[eq(test.lineitem.l_suppkey, test.partsupp.ps_suppkey) eq(test.lineitem.l_partkey, test.partsupp.ps_partkey)]", |
| 109 | + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", |
| 110 | + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_suppkey, collate: binary], [name: test.partsupp.ps_partkey, collate: binary]", |
| 111 | + " │ └─TableFullScan 10000.00 mpp[tiflash] table:partsupp keep order:false, stats:pseudo", |
| 112 | + " └─ExchangeReceiver(Probe) 12500.00 mpp[tiflash] ", |
| 113 | + " └─ExchangeSender 12500.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.lineitem.l_suppkey, collate: binary], [name: test.lineitem.l_partkey, collate: binary]", |
| 114 | + " └─Projection 12500.00 mpp[tiflash] test.lineitem.l_orderkey, test.lineitem.l_partkey, test.lineitem.l_suppkey, test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.supplier.s_nationkey, test.supplier.s_suppkey", |
| 115 | + " └─HashJoin 12500.00 mpp[tiflash] inner join, equal:[eq(test.lineitem.l_suppkey, test.supplier.s_suppkey)]", |
| 116 | + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", |
| 117 | + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.lineitem.l_suppkey, collate: binary]", |
| 118 | + " │ └─Projection 10000.00 mpp[tiflash] test.lineitem.l_orderkey, test.lineitem.l_partkey, test.lineitem.l_suppkey, test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount", |
| 119 | + " │ └─HashJoin 10000.00 mpp[tiflash] inner join, equal:[eq(test.part.p_partkey, test.lineitem.l_partkey)]", |
| 120 | + " │ ├─ExchangeReceiver(Build) 8000.00 mpp[tiflash] ", |
| 121 | + " │ │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.part.p_partkey, collate: binary]", |
| 122 | + " │ │ └─Selection 8000.00 mpp[tiflash] like(test.part.p_name, \"%dim%\", 92)", |
| 123 | + " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:part pushed down filter:empty, keep order:false, stats:pseudo", |
| 124 | + " │ └─ExchangeReceiver(Probe) 10000.00 mpp[tiflash] ", |
| 125 | + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.lineitem.l_partkey, collate: binary]", |
| 126 | + " │ └─TableFullScan 10000.00 mpp[tiflash] table:lineitem keep order:false, stats:pseudo", |
| 127 | + " └─ExchangeReceiver(Probe) 10000.00 mpp[tiflash] ", |
| 128 | + " └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_suppkey, collate: binary]", |
| 129 | + " └─TableFullScan 10000.00 mpp[tiflash] table:supplier keep order:false, stats:pseudo" |
| 130 | + ] |
| 131 | + } |
| 132 | + ] |
| 133 | + }, |
76 | 134 | {
|
77 | 135 | "Name": "TestQ13",
|
78 | 136 | "Cases": [
|
|
0 commit comments