+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                                                                                                                                                                                           |
+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan  | Sort: orders.o_totalprice DESC NULLS FIRST, orders.o_orderdate ASC NULLS LAST                                                                                                                                                                                                  |
|               |   Aggregate: groupBy=[[customer.c_name, customer.c_custkey, orders.o_orderkey, orders.o_orderdate, orders.o_totalprice]], aggr=[[SUM(lineitem.l_quantity)]]                                                                                                                    |
|               |     LeftSemi Join: orders.o_orderkey = __correlated_sq_1.l_orderkey                                                                                                                                                                                                            |
|               |       Projection: customer.c_custkey, customer.c_name, orders.o_orderkey, orders.o_totalprice, orders.o_orderdate, lineitem.l_quantity                                                                                                                                         |
|               |         Inner Join: orders.o_orderkey = lineitem.l_orderkey                                                                                                                                                                                                                    |
|               |           Projection: customer.c_custkey, customer.c_name, orders.o_orderkey, orders.o_totalprice, orders.o_orderdate                                                                                                                                                          |
|               |             Inner Join: customer.c_custkey = orders.o_custkey                                                                                                                                                                                                                  |
|               |               TableScan: customer projection=[c_custkey, c_name]                                                                                                                                                                                                               |
|               |               TableScan: orders projection=[o_orderkey, o_custkey, o_totalprice, o_orderdate]                                                                                                                                                                                  |
|               |           TableScan: lineitem projection=[l_orderkey, l_quantity]                                                                                                                                                                                                              |
|               |       SubqueryAlias: __correlated_sq_1                                                                                                                                                                                                                                         |
|               |         Projection: lineitem.l_orderkey AS l_orderkey                                                                                                                                                                                                                          |
|               |           Filter: SUM(lineitem.l_quantity) > Decimal128(Some(30000),25,2)                                                                                                                                                                                                      |
|               |             Aggregate: groupBy=[[lineitem.l_orderkey]], aggr=[[SUM(lineitem.l_quantity)]]                                                                                                                                                                                      |
|               |               TableScan: lineitem projection=[l_orderkey, l_quantity]                                                                                                                                                                                                          |
| physical_plan | SortPreservingMergeExec: [o_totalprice@4 DESC,o_orderdate@3 ASC NULLS LAST]                                                                                                                                                                                                    |
|               |   SortExec: expr=[o_totalprice@4 DESC,o_orderdate@3 ASC NULLS LAST]                                                                                                                                                                                                            |
|               |     AggregateExec: mode=FinalPartitioned, gby=[c_name@0 as c_name, c_custkey@1 as c_custkey, o_orderkey@2 as o_orderkey, o_orderdate@3 as o_orderdate, o_totalprice@4 as o_totalprice], aggr=[SUM(lineitem.l_quantity)]                                                        |
|               |       CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                              |
|               |         RepartitionExec: partitioning=Hash([Column { name: "c_name", index: 0 }, Column { name: "c_custkey", index: 1 }, Column { name: "o_orderkey", index: 2 }, Column { name: "o_orderdate", index: 3 }, Column { name: "o_totalprice", index: 4 }], 2), input_partitions=2 |
|               |           AggregateExec: mode=Partial, gby=[c_name@1 as c_name, c_custkey@0 as c_custkey, o_orderkey@2 as o_orderkey, o_orderdate@4 as o_orderdate, o_totalprice@3 as o_totalprice], aggr=[SUM(lineitem.l_quantity)]                                                           |
|               |             CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                        |
|               |               HashJoinExec: mode=Partitioned, join_type=LeftSemi, on=[(Column { name: "o_orderkey", index: 2 }, Column { name: "l_orderkey", index: 0 })]                                                                                                                      |
|               |                 ProjectionExec: expr=[c_custkey@0 as c_custkey, c_name@1 as c_name, o_orderkey@2 as o_orderkey, o_totalprice@3 as o_totalprice, o_orderdate@4 as o_orderdate, l_quantity@6 as l_quantity]                                                                      |
|               |                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                  |
|               |                     HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "o_orderkey", index: 2 }, Column { name: "l_orderkey", index: 0 })]                                                                                                                   |
|               |                       CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                              |
|               |                         RepartitionExec: partitioning=Hash([Column { name: "o_orderkey", index: 2 }], 2), input_partitions=2                                                                                                                                                   |
|               |                           RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=2                                                                                                                                                                                 |
|               |                             ProjectionExec: expr=[c_custkey@0 as c_custkey, c_name@1 as c_name, o_orderkey@2 as o_orderkey, o_totalprice@4 as o_totalprice, o_orderdate@5 as o_orderdate]                                                                                      |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                      |
|               |                                 HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "c_custkey", index: 0 }, Column { name: "o_custkey", index: 1 })]                                                                                                         |
|               |                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                  |
|               |                                     RepartitionExec: partitioning=Hash([Column { name: "c_custkey", index: 0 }], 2), input_partitions=0                                                                                                                                        |
|               |                                       MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                             |
|               |                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                  |
|               |                                     RepartitionExec: partitioning=Hash([Column { name: "o_custkey", index: 1 }], 2), input_partitions=0                                                                                                                                        |
|               |                                       MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                             |
|               |                       CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                              |
|               |                         RepartitionExec: partitioning=Hash([Column { name: "l_orderkey", index: 0 }], 2), input_partitions=0                                                                                                                                                   |
|               |                           MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                         |
|               |                 ProjectionExec: expr=[l_orderkey@0 as l_orderkey]                                                                                                                                                                                                              |
|               |                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                  |
|               |                     FilterExec: SUM(lineitem.l_quantity)@1 > Some(30000),25,2                                                                                                                                                                                                  |
|               |                       AggregateExec: mode=FinalPartitioned, gby=[l_orderkey@0 as l_orderkey], aggr=[SUM(lineitem.l_quantity)]                                                                                                                                                  |
|               |                         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                            |
|               |                           RepartitionExec: partitioning=Hash([Column { name: "l_orderkey", index: 0 }], 2), input_partitions=2                                                                                                                                                 |
|               |                             RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=0                                                                                                                                                                               |
|               |                               AggregateExec: mode=Partial, gby=[l_orderkey@0 as l_orderkey], aggr=[SUM(lineitem.l_quantity)]                                                                                                                                                   |
|               |                                 MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                   |
|               |                                                                                                                                                                                                                                                                                |
+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+