You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "kecookier (via GitHub)" <gi...@apache.org> on 2024/03/08 05:30:26 UTC
[I] Results is inconsistent with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
kecookier opened a new issue, #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891
### Backend
VL (Velox)
### Bug description
The type of column `ind_order_amount` in `SrcTable` is `decimal(20,4)`, and the type of column `week_ind_order_amount`
in `TableTarget` is `float`.
The following SQL snippet shows that the calculation of colum`week_ind_order_amount` for Gluten is inconsistent with the Vanilla version, as detailed in the screenshot.
gluten branch https://github.com/apache/incubator-gluten/tree/branch-1.1
```sql
INSERT OVERWRITE TABLE `TableTarget` PARTITION (dt='2024-02-29')
SELECT
a.deal_id,
SUM(a.quantity) AS week_quantity,
SUM(a.ind_quantity) AS week_ind_quantity,
SUM(a.ind_order_amount) AS week_ind_order_amount,
SUM(a.user_cnt) AS week_user_cnt,
FROM
(
SELECT deal_id,
quantity,
ind_quantity,
ind_order_amount,
user_cnt,
FROM SrcTable
WHERE partition_date BETWEEN '2024-01-31' AND '2024-02-29'
AND deal_id IS NOT NULL
) a
GROUP BY deal_id;
```

### Spark version
None
### Spark configurations
_No response_
### System information
_No response_
### Relevant logs
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] Results is inconsistent with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "kecookier (via GitHub)" <gi...@apache.org>.
kecookier commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1985065585
cc @zhouyuan @rui-mo Could you please help me take a look at this issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] [VL] Results are mismatch with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "kecookier (via GitHub)" <gi...@apache.org>.
kecookier commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1990135583
I've identified the error code, and I will submit a velox PR as soon as possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] [VL] Results are mismatch with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "kecookier (via GitHub)" <gi...@apache.org>.
kecookier commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1990911877
> I've identified the error code, and I will submit a velox PR as soon as possible.
cc @rui-mo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] [VL] Results are mismatch with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "kecookier (via GitHub)" <gi...@apache.org>.
kecookier commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1985072900
SrcTable test data
```
deal_id | ind_order_amount
------------+--------------------------
952732041 | 2599.0000
952732041 | 2599.0000
952732041 | 0.0000
952732041 | 10396.0000
952732041 | 5198.0000
952732041 | 2599.0000
952732041 | 0.0000
952732041 | 0.0000
952732041 | 2599.0000
952732041 | 2599.0000
```
Expect 28589.0
Actual 28588.998
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] [VL] Results are mismatch with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "rui-mo (via GitHub)" <gi...@apache.org>.
rui-mo commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1985137646
@kecookier Do you find this issue is caused by `cast(decimal as float)`? If so, could you provide a decimal value before cast so I can reproduce the result difference? Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [I] [VL] Results are mismatch with the vanilla Spark when cast(sum(decmial(20,4)), float) [incubator-gluten]
Posted by "kecookier (via GitHub)" <gi...@apache.org>.
kecookier commented on issue #4891:
URL: https://github.com/apache/incubator-gluten/issues/4891#issuecomment-1988350853
> @kecookier Do you find this issue is caused by `cast(decimal as float)`? If so, could you provide a decimal value before cast so I can reproduce the result difference? Thanks.
```
SELECT cast(sum(cast(col as decimal(20, 4))) as float) FROM VALUES (2599.0000), (2599.0000), (2599.0000), (2599.0000), (2599.0000), (10396.0000), (5198.0000) AS tab(col);
```
You can use the following SQL statement to reproduce the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org