zgramana opened a new pull request #7032:
URL: https://github.com/apache/arrow/pull/7032


   Takes an alternative approach to completing 
[ARROW-6603](https://issues.apache.org/jira/browse/ARROW-6603) that is in-line 
with the current API and  with other Arrow implementations. More specifically, 
this PR finishes the previously stubbed out implementation already in the 
codebase (e.g. uses the existing `NullBitmapBuffer`).
   
   The biggest challenge was finding a mechanism capable of supporting both 
nullable and non-nullable types with minimal changes to existing code. This was 
accomplished with the addition of the following builder interface member:
   
   ```csharp
   public interface IArrowArrayBuilder<T, out TArray, out TBuilder> : 
IArrowArrayBuilder<TArray, TBuilder>
       where TArray : IArrowArray
       where TBuilder : IArrowArrayBuilder<TArray>
   {
       ...
       TBuilder AppendNull();
       ...
   }
   ```
   
   The bulk of the implementation work focuses on adding the implementation of 
`AppendNull` to `PrimitiveArrayBuilder` and `Binary.BuilderBase`, and removing 
hardcoded `0`'s passed as arguments to `nullCount` in the `ArrayData` 
constructors.
   
   This adds two new tests to `ArrayBuilderTests`:
   
   * The first includes a number of `null` scenarios using 
`TestArrayBuilder<T,U>(...)`.
   * The second includes a `StringArray.Builder` scenario with mixed `null` and 
`string.Empty` values. I implemented it such that `string.Empty` is considered 
a valid value (so it increments `Offset` without adding any bytes to 
`ValueBuffer`. When `null` is passed to `Append` it will just invoke 
`AppendNull` internally instead.
   
   And adds two new tests to `ArrowArrayTests` which focus on the behavior of 
`Slice`:
   
   * `SlicePrimitiveArrayWithNulls`
   * `SliceStringArrayWithNullsAndEmptyStrings`
   
   All 162 (existing + new) tests passed locally at the time this was submitted


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to