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/09/11 13:21:34 UTC
[I] Cast from Decimal(p, s) to dictionary-encoded Decimal(p, s) loses precision and scale [arrow-rs]
andygrove opened a new issue, #6381:
URL: https://github.com/apache/arrow-rs/issues/6381
**Describe the bug**
<!--
A clear and concise description of what the bug is.
-->
I have code that calls `cast_with_options` to cast `Decimal128(7, 2)` to `Dictionary<Int32, Decimal128(7,2)>` but it actually produces `Dictionary<Int32, Decimal128(38, 10)>`.
I can see that this is because we ignore the precision and scale in the code in `cast_to_dictionary`:
```rust
Decimal128(_, _) => {
pack_numeric_to_dictionary::<K, Decimal128Type>(array, dict_value_type, cast_options)
}
```
**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 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] Cast from Decimal(p, s) to dictionary-encoded Decimal(p, s) loses precision and scale [arrow-rs]
Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan closed issue #6381: Cast from Decimal(p, s) to dictionary-encoded Decimal(p, s) loses precision and scale
URL: https://github.com/apache/arrow-rs/issues/6381
--
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] Cast from Decimal(p, s) to dictionary-encoded Decimal(p, s) loses precision and scale [arrow-rs]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #6381:
URL: https://github.com/apache/arrow-rs/issues/6381#issuecomment-2343660782
I plan on submitting a PR to fix this.
--
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