You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/23 01:52:28 UTC

[GitHub] [arrow-rs] viirya commented on pull request #3152: Support decimal negative scale

viirya commented on PR #3152:
URL: https://github.com/apache/arrow-rs/pull/3152#issuecomment-1324450259

   > I think we probably want to do a quick parse over the codebase for places that assume the scale is unsigned.
   > 
   > Doing a search for `scale as` shows a couple of `scale as usize` which are likely incorrect
   
   These `scale as usize` in `format_decimal_str` should be safe as negative case is handled in advance.
   
   Other `scale as` usages include some in csv reader (`scale as u8` and `scale as u32`), and the scale is from parsing. I think it is safe because we cannot parse a negative scale.
   
   Another two is `scale as i32` in ipc when passing i8 scale to i32 into ipc `DecimalBuilder`. This should be safe too.
   
   The problematic one is to convert `scale` to u32 in `cast_integer_to_decimal`. I'm fixing it and will add one test.


-- 
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