zgramana commented on a change in pull request #7032: URL: https://github.com/apache/arrow/pull/7032#discussion_r416050847
########## File path: csharp/src/Apache.Arrow/Arrays/PrimitiveArrayBuilder.cs ########## @@ -99,43 +105,63 @@ public abstract class PrimitiveArrayBuilder<T, TArray, TBuilder> : IArrowArrayBu { protected TBuilder Instance => this as TBuilder; protected ArrowBuffer.Builder<T> ValueBuffer { get; } + protected BooleanArray.Builder ValidityBuffer { get; } public int Length => ValueBuffer.Length; + protected int NullCount { get; set; } + // TODO: Implement support for null values (null bitmaps) internal PrimitiveArrayBuilder() { ValueBuffer = new ArrowBuffer.Builder<T>(); + ValidityBuffer = new BooleanArray.Builder(); } public TBuilder Resize(int length) { ValueBuffer.Resize(length); + ValidityBuffer.Resize(length + 1); return Instance; } public TBuilder Reserve(int capacity) { ValueBuffer.Reserve(capacity); + ValidityBuffer.Reserve(capacity + 1); return Instance; } public TBuilder Append(T value) { ValueBuffer.Append(value); + ValidityBuffer.Append(true); return Instance; } public TBuilder Append(ReadOnlySpan<T> span) { ValueBuffer.Append(span); + ValidityBuffer.Append(span != Span<T>.Empty); Review comment: Gah! Forgot to refactor here after fixing it in `BinaryBuilder`. Thanks. ---------------------------------------------------------------- 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