alamb commented on issue #4840: URL: https://github.com/apache/arrow-rs/issues/4840#issuecomment-1908150493
> Physical and logical null are truly confusing. I agree @waynexia I don't quite follow your examples with 4 different types of null. If you need to quickly create an array that represents entirely null of a single type, there is [`new_null_array`](https://docs.rs/arrow/latest/arrow/array/fn.new_null_array.html), but as you seem to imply that certainly results in a larger array than strictly necessary It is fast to check for an array that contains only nulls by using [`Array::nulls`](https://docs.rs/arrow/latest/arrow/array/trait.Array.html#tymethod.nulls) I think like: ```rust let num_nulls = array.nulls().map(|nulls| nulls.null_count()).unwrap_or(0) let is_all_null = num_nulls = array.len(); ``` Though as the docs say, this isn't correct for Dictionary or REE arrays -- 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]
