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/08/08 19:15:19 UTC

[GitHub] [arrow-rs] viirya commented on issue #2362: The constructor `DataType::Decimal(usize, usize)` is unsound.

viirya commented on issue #2362:
URL: https://github.com/apache/arrow-rs/issues/2362#issuecomment-1208508623

   C++ Decimal type has such check, e.g. Decimal128Type: https://github.com/apache/arrow/blob/6cc37cf2d1ba72c46b64fbc7ac499bd0d7296d20/cpp/src/arrow/type.cc#L870-L874
   
   But I am not sure if we need to have the check. For unsafe paths, we run value validation which includes such check. For safe paths, I think it assumes the inputs are all valid (including decimal type). You can mess the array with either wrong type or input in safe paths.
   
   It appears to me that's a bit verbose when constructing a decimal type with a struct or matching a decimal type. So I personally feel that it has a little advantage but also has some more disadvantage.
   
   I don't feel strong against it, though.
   
   
   
   


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