tustvold commented on code in PR #4691:
URL: https://github.com/apache/arrow-rs/pull/4691#discussion_r1292317385
##########
arrow-array/src/array/mod.rs:
##########
@@ -226,6 +253,19 @@ pub trait Array: std::fmt::Debug + Send + Sync {
self.nulls().map(|n| n.null_count()).unwrap_or_default()
}
+ /// Returns `false` if the array is guaranteed to not contain any logical
nulls
+ ///
+ /// In general this will be equivalent to `Array::null_count() != 0` but
may differ in the
+ /// presence of logical nullability, see [`Array::logical_nulls`].
+ ///
+ /// Implementations will return `true` unless they can cheaply prove no
logical nulls
+ /// are present. For example a [`DictionaryArray`] with nullable values
will still return true,
+ /// even if the nulls present in [`DictionaryArray::values`] are not
referenced by any key,
+ /// and therefore would not appear in [`Array::logical_nulls`].
+ fn is_nullable(&self) -> bool {
Review Comment:
I debated calling this method is_required instead, but figured it was better
to stick with consistent terminology, and this matches the method on `Field`
--
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]