Uh oh!
There was an error while loading. Please reload this page.
ARROW-13067: [C++][Compute] Implement integer to decimal cast - #11045
ARROW-13067: [C++][Compute] Implement integer to decimal cast#11045cyb70289 wants to merge 2 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
edponce
commented
Sep 1, 2021
LGTM. Thanks for resolving this issue. |
Uh oh!
There was an error while loading. Please reload this page.
| options.to_type = decimal256(76, 67); | ||
| CheckCastFails(ArrayFromJSON(int32(), "[0]"), options); | ||
| } |
There was a problem hiding this comment.
Should we file a follow up issue to allow truncation via an unsafe cast in these cases?
| CheckDispatchBest(name, {int64(), decimal128(1, 0)}, | ||
| {decimal128(1, 0), decimal128(1, 0)}); | ||
| CheckDispatchBest(name, {decimal128(1, 0), int64()}, | ||
| {decimal128(1, 0), decimal128(1, 0)}); |
There was a problem hiding this comment.
Hmm, so an int64 is cast to a 1-digit decimal? Unrelated to this PR surely, but I'm a bit surprised :-)
There was a problem hiding this comment.
I think this is testing that given an integer and a decimal, the integer is cast to a decimal of the same width/precision/scale.
There was a problem hiding this comment.
But surely the actual cast from int64 to decimal128(1,0) will fail in the precision check?
There was a problem hiding this comment.
Ah, right. Maybe we want the cast logic to be smarter about that, then. As you said, though, that can be tackled separately.
There was a problem hiding this comment.
Jira issue created
https://issues.apache.org/jira/browse/ARROW-13856
Closesapache#11045 from cyb70289/13067-int2dec Authored-by: Yibo Cai <yibo.cai@arm.com> Signed-off-by: Yibo Cai <yibo.cai@arm.com>
No description provided.