HadrienG2 opened a new pull request, #5754:
URL: https://github.com/apache/arrow-rs/pull/5754

   # Which issue does this PR close?
   
   Closes #5749.
   
   # Rationale for this change
   
   This makes the interface of different builder types more consistent, and 
enables exposing builder contents as a slice in more cases in my prototype for 
#5700.
   
   # What changes are included in this PR?
   
   Overall, my general process was to look at what 
`append_null()`/`append(false)` pushes the null into, and expose the 
corresponding null buffer.
   
   - For each builder which has an inner null buffer builder, it is exposed as 
already done in `BooleanBuilder` and `PrimitiveBuilder`.
   - For builders that use a dictionary-like (key, value) layout, the null 
buffer of keys is treated as the overall null buffer of the builder, following 
the example of `append_null()`.
   
   This only leaves the following builders **without** a null buffer accessor 
after this PR:
   
   - `XyzRunBuilder`: For these builder types, the null buffer is per-run, not 
per-element. It is not yet clear to me if/how that should be exposed, so I'm 
leaving this for a future PR.
   - `UnionBuilder`: For this builder type, each variant has its own null 
buffer, so there is no notion of builder-wide null buffer.  This would be best 
handled by exposing some sort of access to the storage of individual variants, 
but again, this requires more design work, so I'm leaving it for a future PR.
   
   # Are there any user-facing changes?
   
   More builders expose a `validity_slice(&self) -> Option<&[u8]>` method. 
Since the semantics are identical to pre-existing methods from other builders 
with this name, the documentation was copy-pasted from there.


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

Reply via email to