+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                                                                                                                                                                                                                                                            |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan  | Sort: custsale.cntrycode ASC NULLS LAST                                                                                                                                                                                                                                                                                                         |
|               |   Projection: custsale.cntrycode, COUNT(UInt8(1)) AS numcust, SUM(custsale.c_acctbal) AS totacctbal                                                                                                                                                                                                                                             |
|               |     Aggregate: groupBy=[[custsale.cntrycode]], aggr=[[COUNT(UInt8(1)), SUM(custsale.c_acctbal)]]                                                                                                                                                                                                                                                |
|               |       SubqueryAlias: custsale                                                                                                                                                                                                                                                                                                                   |
|               |         Projection: substr(customer.c_phone, Int64(1), Int64(2)) AS cntrycode, customer.c_acctbal                                                                                                                                                                                                                                               |
|               |           Filter: CAST(customer.c_acctbal AS Decimal128(19, 6)) > __scalar_sq_1.__value                                                                                                                                                                                                                                                         |
|               |             CrossJoin:                                                                                                                                                                                                                                                                                                                          |
|               |               Projection: customer.c_phone, customer.c_acctbal                                                                                                                                                                                                                                                                                  |
|               |                 LeftAnti Join: customer.c_custkey = orders.o_custkey                                                                                                                                                                                                                                                                            |
|               |                   Filter: substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8("13"), Utf8("31"), Utf8("23"), Utf8("29"), Utf8("30"), Utf8("18"), Utf8("17")])                                                                                                                                                                                |
|               |                     TableScan: customer projection=[c_custkey, c_phone, c_acctbal]                                                                                                                                                                                                                                                              |
|               |                   TableScan: orders projection=[o_custkey]                                                                                                                                                                                                                                                                                      |
|               |               SubqueryAlias: __scalar_sq_1                                                                                                                                                                                                                                                                                                      |
|               |                 Projection: AVG(customer.c_acctbal) AS __value                                                                                                                                                                                                                                                                                  |
|               |                   Aggregate: groupBy=[[]], aggr=[[AVG(customer.c_acctbal)]]                                                                                                                                                                                                                                                                     |
|               |                     Projection: customer.c_acctbal                                                                                                                                                                                                                                                                                              |
|               |                       Filter: customer.c_acctbal > Decimal128(Some(0),15,2) AND substr(customer.c_phone, Int64(1), Int64(2)) IN ([Utf8("13"), Utf8("31"), Utf8("23"), Utf8("29"), Utf8("30"), Utf8("18"), Utf8("17")])                                                                                                                          |
|               |                         TableScan: customer projection=[c_phone, c_acctbal]                                                                                                                                                                                                                                                                     |
| physical_plan | SortPreservingMergeExec: [cntrycode@0 ASC NULLS LAST]                                                                                                                                                                                                                                                                                           |
|               |   SortExec: expr=[cntrycode@0 ASC NULLS LAST]                                                                                                                                                                                                                                                                                                   |
|               |     ProjectionExec: expr=[cntrycode@0 as cntrycode, COUNT(UInt8(1))@1 as numcust, SUM(custsale.c_acctbal)@2 as totacctbal]                                                                                                                                                                                                                      |
|               |       AggregateExec: mode=FinalPartitioned, gby=[cntrycode@0 as cntrycode], aggr=[COUNT(UInt8(1)), SUM(custsale.c_acctbal)]                                                                                                                                                                                                                     |
|               |         CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                             |
|               |           RepartitionExec: partitioning=Hash([Column { name: "cntrycode", index: 0 }], 2), input_partitions=1                                                                                                                                                                                                                                   |
|               |             AggregateExec: mode=Partial, gby=[cntrycode@0 as cntrycode], aggr=[COUNT(UInt8(1)), SUM(custsale.c_acctbal)]                                                                                                                                                                                                                        |
|               |               ProjectionExec: expr=[substr(c_phone@0, 1, 2) as cntrycode, c_acctbal@1 as c_acctbal]                                                                                                                                                                                                                                             |
|               |                 CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                                     |
|               |                   FilterExec: CAST(c_acctbal@1 AS Decimal128(19, 6)) > __value@2                                                                                                                                                                                                                                                                |
|               |                     CrossJoinExec                                                                                                                                                                                                                                                                                                               |
|               |                       CoalescePartitionsExec                                                                                                                                                                                                                                                                                                    |
|               |                         ProjectionExec: expr=[c_phone@1 as c_phone, c_acctbal@2 as c_acctbal]                                                                                                                                                                                                                                                   |
|               |                           CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                           |
|               |                             HashJoinExec: mode=Partitioned, join_type=LeftAnti, on=[(Column { name: "c_custkey", index: 0 }, Column { name: "o_custkey", index: 0 })]                                                                                                                                                                           |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                       |
|               |                                 RepartitionExec: partitioning=Hash([Column { name: "c_custkey", index: 0 }], 2), input_partitions=2                                                                                                                                                                                                             |
|               |                                   RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=0                                                                                                                                                                                                                                          |
|               |                                     CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                 |
|               |                                       FilterExec: Use substr(c_phone@1, 1, 2) IN (SET) ([Literal { value: Utf8("13") }, Literal { value: Utf8("31") }, Literal { value: Utf8("23") }, Literal { value: Utf8("29") }, Literal { value: Utf8("30") }, Literal { value: Utf8("18") }, Literal { value: Utf8("17") }])                              |
|               |                                         MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                            |
|               |                               CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                       |
|               |                                 RepartitionExec: partitioning=Hash([Column { name: "o_custkey", index: 0 }], 2), input_partitions=0                                                                                                                                                                                                             |
|               |                                   MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                                  |
|               |                       ProjectionExec: expr=[AVG(customer.c_acctbal)@0 as __value]                                                                                                                                                                                                                                                               |
|               |                         AggregateExec: mode=Final, gby=[], aggr=[AVG(customer.c_acctbal)]                                                                                                                                                                                                                                                       |
|               |                           CoalescePartitionsExec                                                                                                                                                                                                                                                                                                |
|               |                             AggregateExec: mode=Partial, gby=[], aggr=[AVG(customer.c_acctbal)]                                                                                                                                                                                                                                                 |
|               |                               RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=0                                                                                                                                                                                                                                              |
|               |                                 ProjectionExec: expr=[c_acctbal@1 as c_acctbal]                                                                                                                                                                                                                                                                 |
|               |                                   CoalesceBatchesExec: target_batch_size=8192                                                                                                                                                                                                                                                                   |
|               |                                     FilterExec: c_acctbal@1 > Some(0),15,2 AND Use substr(c_phone@0, 1, 2) IN (SET) ([Literal { value: Utf8("13") }, Literal { value: Utf8("31") }, Literal { value: Utf8("23") }, Literal { value: Utf8("29") }, Literal { value: Utf8("30") }, Literal { value: Utf8("18") }, Literal { value: Utf8("17") }]) |
|               |                                       MemoryExec: partitions=0, partition_sizes=[]                                                                                                                                                                                                                                                              |
|               |                                                                                                                                                                                                                                                                                                                                                 |
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+