Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal multiply kernel should not cause precision loss #5980

Merged
merged 17 commits into from
Apr 20, 2023
Merged
46 changes: 23 additions & 23 deletions benchmarks/expected-plans/q1.txt

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions benchmarks/expected-plans/q10.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions benchmarks/expected-plans/q11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| | 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)) > __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)))]] |
| | Aggregate: groupBy=[[partsupp.ps_partkey]], aggr=[[SUM(partsupp.ps_supplycost * CAST(partsupp.ps_availqty AS Decimal128(10, 0)))]] |
| | Projection: partsupp.ps_partkey, partsupp.ps_availqty, partsupp.ps_supplycost |
| | Inner Join: supplier.s_nationkey = nation.n_nationkey |
| | Projection: partsupp.ps_partkey, partsupp.ps_availqty, partsupp.ps_supplycost, supplier.s_nationkey |
Expand All @@ -17,7 +17,7 @@
| | TableScan: nation projection=[n_nationkey, n_name] |
| | SubqueryAlias: __scalar_sq_1 |
| | 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)))]] |
| | Aggregate: groupBy=[[]], aggr=[[SUM(partsupp.ps_supplycost * CAST(partsupp.ps_availqty AS Decimal128(10, 0)))]] |
| | Projection: partsupp.ps_availqty, partsupp.ps_supplycost |
| | Inner Join: supplier.s_nationkey = nation.n_nationkey |
| | Projection: partsupp.ps_availqty, partsupp.ps_supplycost, supplier.s_nationkey |
Expand Down
60 changes: 30 additions & 30 deletions benchmarks/expected-plans/q14.txt

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions benchmarks/expected-plans/q15.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion benchmarks/expected-plans/q19.txt

Large diffs are not rendered by default.

110 changes: 55 additions & 55 deletions benchmarks/expected-plans/q3.txt

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions benchmarks/expected-plans/q5.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions benchmarks/expected-plans/q7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| | Projection: shipping.supp_nation, shipping.cust_nation, shipping.l_year, SUM(shipping.volume) AS revenue |
| | Aggregate: groupBy=[[shipping.supp_nation, shipping.cust_nation, shipping.l_year]], aggr=[[SUM(shipping.volume)]] |
| | SubqueryAlias: shipping |
| | Projection: n1.n_name AS supp_nation, n2.n_name AS cust_nation, datepart(Utf8("YEAR"), lineitem.l_shipdate) AS l_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)) AS volume |
| | Projection: n1.n_name AS supp_nation, n2.n_name AS cust_nation, datepart(Utf8("YEAR"), lineitem.l_shipdate) AS l_year, lineitem.l_extendedprice * (Decimal128(Some(1),20,0) - lineitem.l_discount) AS volume |
| | Inner Join: customer.c_nationkey = n2.n_nationkey Filter: n1.n_name = Utf8("FRANCE") AND n2.n_name = Utf8("GERMANY") OR n1.n_name = Utf8("GERMANY") AND n2.n_name = Utf8("FRANCE") |
| | Projection: lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate, customer.c_nationkey, n1.n_name |
| | Inner Join: supplier.s_nationkey = n1.n_nationkey |
Expand Down Expand Up @@ -33,7 +33,7 @@
| | CoalesceBatchesExec: target_batch_size=8192 |
| | RepartitionExec: partitioning=Hash([Column { name: "supp_nation", index: 0 }, Column { name: "cust_nation", index: 1 }, Column { name: "l_year", index: 2 }], 2), input_partitions=2 |
| | AggregateExec: mode=Partial, gby=[supp_nation@0 as supp_nation, cust_nation@1 as cust_nation, l_year@2 as l_year], aggr=[SUM(shipping.volume)] |
| | ProjectionExec: expr=[n_name@4 as supp_nation, n_name@6 as cust_nation, datepart(YEAR, l_shipdate@2) as l_year, CAST(l_extendedprice@0 AS Decimal128(38, 4)) * CAST(Some(100),23,2 - CAST(l_discount@1 AS Decimal128(23, 2)) AS Decimal128(38, 4)) as volume] |
| | ProjectionExec: expr=[n_name@4 as supp_nation, n_name@6 as cust_nation, datepart(YEAR, l_shipdate@2) as l_year, l_extendedprice@0 * (Some(1),20,0 - l_discount@1) as volume] |
| | CoalesceBatchesExec: target_batch_size=8192 |
| | HashJoinExec: mode=Partitioned, join_type=Inner, on=[(Column { name: "c_nationkey", index: 3 }, Column { name: "n_nationkey", index: 0 })], filter=BinaryExpr { left: BinaryExpr { left: BinaryExpr { left: Column { name: "n_name", index: 0 }, op: Eq, right: Literal { value: Utf8("FRANCE") } }, op: And, right: BinaryExpr { left: Column { name: "n_name", index: 1 }, op: Eq, right: Literal { value: Utf8("GERMANY") } } }, op: Or, right: BinaryExpr { left: BinaryExpr { left: Column { name: "n_name", index: 0 }, op: Eq, right: Literal { value: Utf8("GERMANY") } }, op: And, right: BinaryExpr { left: Column { name: "n_name", index: 1 }, op: Eq, right: Literal { value: Utf8("FRANCE") } } } } |
| | CoalesceBatchesExec: target_batch_size=8192 |
Expand Down
Loading