+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                                                                                                                                                                                                                                                                                                                      |
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan  | Sort: revenue DESC NULLS FIRST                                                                                                                                                                                                                                                                                                                                                                            |
|               |   Projection: customer.c_custkey, customer.c_name, SUM(lineitem.l_extendedprice * Int64(1) - lineitem.l_discount) AS revenue, customer.c_acctbal, nation.n_name, customer.c_address, customer.c_phone, customer.c_comment                                                                                                                                                                                 |
|               |     Aggregate: groupBy=[[customer.c_custkey, customer.c_name, customer.c_acctbal, customer.c_phone, nation.n_name, customer.c_address, customer.c_comment]], aggr=[[SUM(CAST(lineitem.l_extendedprice AS Decimal128(38, 4)) * CAST(Decimal128(Some(100),23,2) - CAST(lineitem.l_discount AS Decimal128(23, 2)) AS Decimal128(38, 4))) AS SUM(lineitem.l_extendedprice * Int64(1) - lineitem.l_discount)]] |
|               |       Projection: customer.c_custkey, customer.c_name, customer.c_address, customer.c_phone, customer.c_acctbal, customer.c_comment, lineitem.l_extendedprice, lineitem.l_discount, nation.n_name                                                                                                                                                                                                         |
|               |         Inner Join: customer.c_nationkey = nation.n_nationkey                                                                                                                                                                                                                                                                                                                                             |
|               |           Projection: customer.c_custkey, customer.c_name, customer.c_address, customer.c_nationkey, customer.c_phone, customer.c_acctbal, customer.c_comment, lineitem.l_extendedprice, lineitem.l_discount                                                                                                                                                                                              |
|               |             Inner Join: orders.o_orderkey = lineitem.l_orderkey                                                                                                                                                                                                                                                                                                                                           |
|               |               Projection: customer.c_custkey, customer.c_name, customer.c_address, customer.c_nationkey, customer.c_phone, customer.c_acctbal, customer.c_comment, orders.o_orderkey                                                                                                                                                                                                                      |
|               |                 Inner Join: customer.c_custkey = orders.o_custkey                                                                                                                                                                                                                                                                                                                                         |
|               |                   TableScan: customer projection=[c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_comment]                                                                                                                                                                                                                                                                               |
|               |                   Projection: orders.o_orderkey, orders.o_custkey                                                                                                                                                                                                                                                                                                                                         |
|               |                     Filter: orders.o_orderdate >= Date32("8674") AND orders.o_orderdate < Date32("8766")                                                                                                                                                                                                                                                                                                  |
|               |                       TableScan: orders projection=[o_orderkey, o_custkey, o_orderdate]                                                                                                                                                                                                                                                                                                                   |
|               |               Projection: lineitem.l_orderkey, lineitem.l_extendedprice, lineitem.l_discount                                                                                                                                                                                                                                                                                                              |
|               |                 Filter: lineitem.l_returnflag = Utf8("R")                                                                                                                                                                                                                                                                                                                                                 |
|               |                   TableScan: lineitem projection=[l_orderkey, l_extendedprice, l_discount, l_returnflag]                                                                                                                                                                                                                                                                                                  |
|               |           TableScan: nation projection=[n_nationkey, n_name]                                                                                                                                                                                                                                                                                                                                              |
| physical_plan | SortPreservingMergeExec: [revenue@2 DESC]                                                                                                                                                                                                                                                                                                                                                                 |
|               |   SortExec: expr=[revenue@2 DESC]                                                                                                                                                                                                                                                                                                                                                                         |
|               |     ProjectionExec: expr=[c_custkey@0 as c_custkey, c_name@1 as c_name, SUM(lineitem.l_extendedprice * Int64(1) - lineitem.l_discount)@7 as revenue, c_acctbal@2 as c_acctbal, n_name@4 as n_name, c_address@5 as c_address, c_phone@3 as c_phone, c_comment@6 as c_comment]                                                                                                                              |
|               |       AggregateExec: mode=FinalPartitioned, gby=[c_custkey@0 as c_custkey, c_name@1 as c_name, c_acctbal@2 as c_acctbal, c_phone@3 as c_phone, n_name@4 as n_name, c_address@5 as c_address, c_comment@6 as c_comment], aggr=[SUM(lineitem.l_extendedprice * Int64(1) - lineitem.l_discount)]                                                                                                             |
|               |         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                                       |
|               |           RepartitionExec: partitioning=Hash([Column { name: "c_custkey", index: 0 }, Column { name: "c_name", index: 1 }, Column { name: "c_acctbal", index: 2 }, Column { name: "c_phone", index: 3 }, Column { name: "n_name", index: 4 }, Column { name: "c_address", index: 5 }, Column { name: "c_comment", index: 6 }], 2), input_partitions=2                                                     |
|               |             AggregateExec: mode=Partial, gby=[c_custkey@0 as c_custkey, c_name@1 as c_name, c_acctbal@4 as c_acctbal, c_phone@3 as c_phone, n_name@8 as n_name, c_address@2 as c_address, c_comment@5 as c_comment], aggr=[SUM(lineitem.l_extendedprice * Int64(1) - lineitem.l_discount)]                                                                                                                |
|               |               ProjectionExec: expr=[c_custkey@0 as c_custkey, c_name@1 as c_name, c_address@2 as c_address, c_phone@4 as c_phone, c_acctbal@5 as c_acctbal, c_comment@6 as c_comment, l_extendedprice@7 as l_extendedprice, l_discount@8 as l_discount, n_name@10 as n_name]                                                                                                                              |
|               |                 CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                               |
|               |                   HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "c_nationkey", index: 3 }, Column { name: "n_nationkey", index: 0 })]                                                                                                                                                                                                                                              |
|               |                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                           |
|               |                       RepartitionExec: partitioning=Hash([Column { name: "c_nationkey", index: 3 }], 2), input_partitions=2                                                                                                                                                                                                                                                                               |
|               |                         ProjectionExec: expr=[c_custkey@0 as c_custkey, c_name@1 as c_name, c_address@2 as c_address, c_nationkey@3 as c_nationkey, c_phone@4 as c_phone, c_acctbal@5 as c_acctbal, c_comment@6 as c_comment, l_extendedprice@9 as l_extendedprice, l_discount@10 as l_discount]                                                                                                          |
|               |                           CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                     |
|               |                             HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "o_orderkey", index: 7 }, Column { name: "l_orderkey", index: 0 })]                                                                                                                                                                                                                                      |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                 |
|               |                                 RepartitionExec: partitioning=Hash([Column { name: "o_orderkey", index: 7 }], 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, c_address@2 as c_address, c_nationkey@3 as c_nationkey, c_phone@4 as c_phone, c_acctbal@5 as c_acctbal, c_comment@6 as c_comment, o_orderkey@7 as o_orderkey]                                                                                                                                     |
|               |                                       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=2                                                                                                                                                                                                                                                           |
|               |                                               RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=0                                                                                                                                                                                                                                                                                        |
|               |                                                 ProjectionExec: expr=[o_orderkey@0 as o_orderkey, o_custkey@1 as o_custkey]                                                                                                                                                                                                                                                                               |
|               |                                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                             |
|               |                                                     FilterExec: o_orderdate@2 >= 8674 AND o_orderdate@2 < 8766                                                                                                                                                                                                                                                                                            |
|               |                                                       MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                                                                        |
|               |                               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                                                                                                                                                                                                                                                                                                    |
|               |                                     ProjectionExec: expr=[l_orderkey@0 as l_orderkey, l_extendedprice@1 as l_extendedprice, l_discount@2 as l_discount]                                                                                                                                                                                                                                                   |
|               |                                       CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                         |
|               |                                         FilterExec: l_returnflag@3 = R                                                                                                                                                                                                                                                                                                                                    |
|               |                                           MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                                                                                    |
|               |                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                                                           |
|               |                       RepartitionExec: partitioning=Hash([Column { name: "n_nationkey", index: 0 }], 2), input_partitions=0                                                                                                                                                                                                                                                                               |
|               |                         MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                                                                                                      |
|               |                                                                                                                                                                                                                                                                                                                                                                                                           |
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+