Skip to content

Commit

Permalink
refactor: move type_coercion to analyzer (#5831)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener authored Apr 5, 2023
1 parent 21bf4ff commit 787d000
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 196 deletions.
8 changes: 4 additions & 4 deletions benchmarks/expected-plans/q11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan | Sort: value DESC NULLS FIRST |
| | Projection: partsupp.ps_partkey, SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS value |
| | Filter: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS Decimal128(38, 15)) > CAST(__scalar_sq_1.__value AS Decimal128(38, 15)) |
| | Filter: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS Decimal128(38, 15)) > __scalar_sq_1.__value |
| | CrossJoin: |
| | Aggregate: groupBy=[[partsupp.ps_partkey]], aggr=[[SUM(CAST(partsupp.ps_supplycost AS Decimal128(26, 2)) * CAST(partsupp.ps_availqty AS Decimal128(26, 2)))]] |
| | Projection: partsupp.ps_partkey, partsupp.ps_availqty, partsupp.ps_supplycost |
Expand All @@ -16,7 +16,7 @@
| | Filter: nation.n_name = Utf8("GERMANY") |
| | TableScan: nation projection=[n_nationkey, n_name] |
| | SubqueryAlias: __scalar_sq_1 |
| | Projection: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS Float64) * Float64(0.0001) AS __value |
| | Projection: CAST(CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty) AS Float64) * Float64(0.0001) AS Decimal128(38, 15)) AS __value |
| | Aggregate: groupBy=[[]], aggr=[[SUM(CAST(partsupp.ps_supplycost AS Decimal128(26, 2)) * CAST(partsupp.ps_availqty AS Decimal128(26, 2)))]] |
| | Projection: partsupp.ps_availqty, partsupp.ps_supplycost |
| | Inner Join: supplier.s_nationkey = nation.n_nationkey |
Expand All @@ -30,7 +30,7 @@
| physical_plan | SortExec: expr=[value@1 DESC] |
| | ProjectionExec: expr=[ps_partkey@0 as ps_partkey, SUM(partsupp.ps_supplycost * partsupp.ps_availqty)@1 as value] |
| | CoalesceBatchesExec: target_batch_size=8192 |
| | FilterExec: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty)@1 AS Decimal128(38, 15)) > CAST(__value@2 AS Decimal128(38, 15)) |
| | FilterExec: CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty)@1 AS Decimal128(38, 15)) > __value@2 |
| | CrossJoinExec |
| | CoalescePartitionsExec |
| | AggregateExec: mode=FinalPartitioned, gby=[ps_partkey@0 as ps_partkey], aggr=[SUM(partsupp.ps_supplycost * partsupp.ps_availqty)] |
Expand Down Expand Up @@ -59,7 +59,7 @@
| | CoalesceBatchesExec: target_batch_size=8192 |
| | FilterExec: n_name@1 = GERMANY |
| | MemoryExec: partitions=0, partition_sizes=[] |
| | ProjectionExec: expr=[CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty)@0 AS Float64) * 0.0001 as __value] |
| | ProjectionExec: expr=[CAST(CAST(SUM(partsupp.ps_supplycost * partsupp.ps_availqty)@0 AS Float64) * 0.0001 AS Decimal128(38, 15)) as __value] |
| | AggregateExec: mode=Final, gby=[], aggr=[SUM(partsupp.ps_supplycost * partsupp.ps_availqty)] |
| | CoalescePartitionsExec |
| | AggregateExec: mode=Partial, gby=[], aggr=[SUM(partsupp.ps_supplycost * partsupp.ps_availqty)] |
Expand Down
Loading

0 comments on commit 787d000

Please sign in to comment.