+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                                                                                                                                                                                                                                                                |
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan  | Sort: profit.nation ASC NULLS LAST, profit.o_year DESC NULLS FIRST                                                                                                                                                                                                                                                                                  |
|               |   Projection: profit.nation, profit.o_year, SUM(profit.amount) AS sum_profit                                                                                                                                                                                                                                                                        |
|               |     Aggregate: groupBy=[[profit.nation, profit.o_year]], aggr=[[SUM(profit.amount)]]                                                                                                                                                                                                                                                                |
|               |       SubqueryAlias: profit                                                                                                                                                                                                                                                                                                                         |
|               |         Projection: nation.n_name AS nation, datepart(Utf8("YEAR"), orders.o_orderdate) AS o_year, 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)) - CAST(partsupp.ps_supplycost * lineitem.l_quantity AS Decimal128(38, 4)) AS amount |
|               |           Inner Join: supplier.s_nationkey = nation.n_nationkey                                                                                                                                                                                                                                                                                     |
|               |             Projection: lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, supplier.s_nationkey, partsupp.ps_supplycost, orders.o_orderdate                                                                                                                                                                                        |
|               |               Inner Join: lineitem.l_orderkey = orders.o_orderkey                                                                                                                                                                                                                                                                                   |
|               |                 Projection: lineitem.l_orderkey, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, supplier.s_nationkey, partsupp.ps_supplycost                                                                                                                                                                                   |
|               |                   Inner Join: lineitem.l_suppkey = partsupp.ps_suppkey, lineitem.l_partkey = partsupp.ps_partkey                                                                                                                                                                                                                                    |
|               |                     Projection: lineitem.l_orderkey, lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, supplier.s_nationkey                                                                                                                                                               |
|               |                       Inner Join: lineitem.l_suppkey = supplier.s_suppkey                                                                                                                                                                                                                                                                           |
|               |                         Projection: lineitem.l_orderkey, lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount                                                                                                                                                                                 |
|               |                           Inner Join: part.p_partkey = lineitem.l_partkey                                                                                                                                                                                                                                                                           |
|               |                             Projection: part.p_partkey                                                                                                                                                                                                                                                                                              |
|               |                               Filter: part.p_name LIKE Utf8("%green%")                                                                                                                                                                                                                                                                              |
|               |                                 TableScan: part projection=[p_partkey, p_name]                                                                                                                                                                                                                                                                      |
|               |                             TableScan: lineitem projection=[l_orderkey, l_partkey, l_suppkey, l_quantity, l_extendedprice, l_discount]                                                                                                                                                                                                              |
|               |                         TableScan: supplier projection=[s_suppkey, s_nationkey]                                                                                                                                                                                                                                                                     |
|               |                     TableScan: partsupp projection=[ps_partkey, ps_suppkey, ps_supplycost]                                                                                                                                                                                                                                                          |
|               |                 TableScan: orders projection=[o_orderkey, o_orderdate]                                                                                                                                                                                                                                                                              |
|               |             TableScan: nation projection=[n_nationkey, n_name]                                                                                                                                                                                                                                                                                      |
| physical_plan | SortPreservingMergeExec: [nation@0 ASC NULLS LAST,o_year@1 DESC]                                                                                                                                                                                                                                                                                    |
|               |   SortExec: expr=[nation@0 ASC NULLS LAST,o_year@1 DESC]                                                                                                                                                                                                                                                                                            |
|               |     ProjectionExec: expr=[nation@0 as nation, o_year@1 as o_year, SUM(profit.amount)@2 as sum_profit]                                                                                                                                                                                                                                               |
|               |       AggregateExec: mode=FinalPartitioned, gby=[nation@0 as nation, o_year@1 as o_year], aggr=[SUM(profit.amount)]                                                                                                                                                                                                                                 |
|               |         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                                 |
|               |           RepartitionExec: partitioning=Hash([Column { name: "nation", index: 0 }, Column { name: "o_year", index: 1 }], 2), input_partitions=2                                                                                                                                                                                                     |
|               |             AggregateExec: mode=Partial, gby=[nation@0 as nation, o_year@1 as o_year], aggr=[SUM(profit.amount)]                                                                                                                                                                                                                                    |
|               |               ProjectionExec: expr=[n_name@7 as nation, datepart(YEAR, o_orderdate@5) as o_year, CAST(l_extendedprice@1 AS Decimal128(38, 4)) * CAST(Some(100),23,2 - CAST(l_discount@2 AS Decimal128(23, 2)) AS Decimal128(38, 4)) - CAST(ps_supplycost@4 * l_quantity@0 AS Decimal128(38, 4)) as amount]                                          |
|               |                 CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                         |
|               |                   HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "s_nationkey", index: 3 }, Column { name: "n_nationkey", index: 0 })]                                                                                                                                                                                        |
|               |                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                     |
|               |                       RepartitionExec: partitioning=Hash([Column { name: "s_nationkey", index: 3 }], 2), input_partitions=2                                                                                                                                                                                                                         |
|               |                         ProjectionExec: expr=[l_quantity@1 as l_quantity, l_extendedprice@2 as l_extendedprice, l_discount@3 as l_discount, s_nationkey@4 as s_nationkey, ps_supplycost@5 as ps_supplycost, o_orderdate@7 as o_orderdate]                                                                                                           |
|               |                           CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                               |
|               |                             HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "l_orderkey", index: 0 }, Column { name: "o_orderkey", index: 0 })]                                                                                                                                                                                |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                           |
|               |                                 RepartitionExec: partitioning=Hash([Column { name: "l_orderkey", index: 0 }], 2), input_partitions=2                                                                                                                                                                                                                |
|               |                                   ProjectionExec: expr=[l_orderkey@0 as l_orderkey, l_quantity@3 as l_quantity, l_extendedprice@4 as l_extendedprice, l_discount@5 as l_discount, s_nationkey@6 as s_nationkey, ps_supplycost@9 as ps_supplycost]                                                                                                   |
|               |                                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                     |
|               |                                       HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "l_suppkey", index: 2 }, Column { name: "ps_suppkey", index: 1 }), (Column { name: "l_partkey", index: 1 }, Column { name: "ps_partkey", index: 0 })]                                                                                    |
|               |                                         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                 |
|               |                                           RepartitionExec: partitioning=Hash([Column { name: "l_suppkey", index: 2 }, Column { name: "l_partkey", index: 1 }], 2), input_partitions=2                                                                                                                                                               |
|               |                                             ProjectionExec: expr=[l_orderkey@0 as l_orderkey, l_partkey@1 as l_partkey, l_suppkey@2 as l_suppkey, l_quantity@3 as l_quantity, l_extendedprice@4 as l_extendedprice, l_discount@5 as l_discount, s_nationkey@7 as s_nationkey]                                                                       |
|               |                                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                           |
|               |                                                 HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "l_suppkey", index: 2 }, Column { name: "s_suppkey", index: 0 })]                                                                                                                                                              |
|               |                                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                       |
|               |                                                     RepartitionExec: partitioning=Hash([Column { name: "l_suppkey", index: 2 }], 2), input_partitions=2                                                                                                                                                                                             |
|               |                                                       ProjectionExec: expr=[l_orderkey@1 as l_orderkey, l_partkey@2 as l_partkey, l_suppkey@3 as l_suppkey, l_quantity@4 as l_quantity, l_extendedprice@5 as l_extendedprice, l_discount@6 as l_discount]                                                                                           |
|               |                                                         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                 |
|               |                                                           HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "p_partkey", index: 0 }, Column { name: "l_partkey", index: 1 })]                                                                                                                                                    |
|               |                                                             CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                             |
|               |                                                               RepartitionExec: partitioning=Hash([Column { name: "p_partkey", index: 0 }], 2), input_partitions=2                                                                                                                                                                                   |
|               |                                                                 RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=0                                                                                                                                                                                                                |
|               |                                                                   ProjectionExec: expr=[p_partkey@0 as p_partkey]                                                                                                                                                                                                                                   |
|               |                                                                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                     |
|               |                                                                       FilterExec: p_name@1 LIKE %green%                                                                                                                                                                                                                                             |
|               |                                                                         MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                |
|               |                                                             CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                             |
|               |                                                               RepartitionExec: partitioning=Hash([Column { name: "l_partkey", index: 1 }], 2), input_partitions=0                                                                                                                                                                                   |
|               |                                                                 MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                        |
|               |                                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                       |
|               |                                                     RepartitionExec: partitioning=Hash([Column { name: "s_suppkey", index: 0 }], 2), input_partitions=0                                                                                                                                                                                             |
|               |                                                       MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                  |
|               |                                         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                 |
|               |                                           RepartitionExec: partitioning=Hash([Column { name: "ps_suppkey", index: 1 }, Column { name: "ps_partkey", index: 0 }], 2), input_partitions=0                                                                                                                                                             |
|               |                                             MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                            |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                           |
|               |                                 RepartitionExec: partitioning=Hash([Column { name: "o_orderkey", index: 0 }], 2), input_partitions=0                                                                                                                                                                                                                |
|               |                                   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=[]                                                                                                                                                                                                                                                                                |
|               |                                                                                                                                                                                                                                                                                                                                                     |
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+