psvri commented on code in PR #3183:
URL: https://github.com/apache/arrow-rs/pull/3183#discussion_r1031738355
##########
arrow-cast/src/display.rs:
##########
@@ -32,13 +32,10 @@ macro_rules! make_string {
($array_type:ty, $column: ident, $row: ident) => {{
let array = $column.as_any().downcast_ref::<$array_type>().unwrap();
- let s = if array.is_null($row) {
- "".to_string()
- } else {
- array.value($row).to_string()
- };
-
- Ok(s)
+ // SAFETY: This is safe because array_value_to_string(the macro
caller) is already
Review Comment:
> This isn't actually true, is_null just checks that the access is within
the bounds of the null bitmap, which may be larger than the array's actual
length - either due to the length not being a multiple of 8 or otherwise.
Thanks for this info.
Even I wasnt so sure to keep it. Let me remove the unchecked calls.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]