You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2024/12/03 23:59:09 UTC
[I] Casting Decimal128 to Decimal128 with smaller precision produces incorrect results in some cases [arrow-rs]
andygrove opened a new issue, #6833:
URL: https://github.com/apache/arrow-rs/issues/6833
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->
If I try and cast floating-point value `12345.67` to `decimal(6,2)` then I get an error, as expected:
```
"1234567 is too large to store in a Decimal128 of precision 6. Max is 999999"
```
However, if I try and cast a `decimal(24,2)` value of `12345.67` to `decimal(6,2)` then I do not get an error but instead have an invalid decimal value.
``
PrimitiveArray<Decimal128(6, 2)>
[
1234567,
]
```
If I then convert this decimal to a string, it produces `1234.56` instead of `12345.67`
```
StringArray
[
"1234.56",
]
```
**To Reproduce**
<!--
Steps to reproduce the behavior:
-->
**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->
**Additional context**
<!--
Add any other context about the problem here.
-->
This is the root cause of https://github.com/apache/datafusion/issues/13492
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Casting Decimal128 to Decimal128 with smaller precision produces incorrect results in some cases [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #6833: Casting Decimal128 to Decimal128 with smaller precision produces incorrect results in some cases
URL: https://github.com/apache/arrow-rs/issues/6833
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Casting Decimal128 to Decimal128 with smaller precision produces incorrect results in some cases [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #6833:
URL: https://github.com/apache/arrow-rs/issues/6833#issuecomment-2549320352
`label_issue.py` automatically added labels {'arrow'} from #6850
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Casting Decimal128 to Decimal128 with smaller precision produces incorrect results in some cases [arrow-rs]
Posted by "himadripal (via GitHub)" <gi...@apache.org>.
himadripal commented on issue #6833:
URL: https://github.com/apache/arrow-rs/issues/6833#issuecomment-2517910950
Working on it
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org