yordan-pavlov commented on a change in pull request #1225:
URL: https://github.com/apache/arrow-rs/pull/1225#discussion_r792199565
##########
File path: arrow/src/array/transform/mod.rs
##########
@@ -377,9 +375,12 @@ impl<'a> MutableArrayData<'a> {
/// returns a new [MutableArrayData] with capacity to `capacity` slots and
specialized to create an
/// [ArrayData] from multiple `arrays`.
///
- /// `use_nulls` is a flag used to optimize insertions. It should be
`false` if the only source of nulls
- /// are the arrays themselves and `true` if the user plans to call
[MutableArrayData::extend_nulls].
- /// In other words, if `use_nulls` is `false`, calling
[MutableArrayData::extend_nulls] should not be used.
+ /// `use_nulls` is a flag used to optimize insertions, if `use_nulls` is
`true` a null bitmap
+ /// will be created regardless of the contents of `arrays`, otherwise a
null bitmap will
+ /// be computed only if `arrays` contains nulls.
+ ///
+ /// Code that plans to call [MutableArrayData::extend_nulls] MUST set
`use_nulls` to `true`,
+ /// in order to ensure that a null bitmap is computed.
pub fn new(arrays: Vec<&'a ArrayData>, use_nulls: bool, capacity: usize)
-> Self {
Review comment:
having thought some more about this, wouldn't something like
`compute_nulls` or `create_null_bitmap` (instead of `use_nulls`) be a better
name, because:
(1) if it's `true`, then a null bitmap is always created, no matter if any
the input arrays have a null bitmap
(2) the documentation comment, I think, reads better as e.g.
```
if `compute_nulls` is `true` a null bitmap will be created regardless of
the contents of `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]