public BooleanArray Build(MemoryAllocator allocator = default) { var validityBuffer = NullCount > 0 ? ValidityBuffer.Build(allocator) : ArrowBuffer.Empty; return(new BooleanArray( ValueBuffer.Build(allocator), validityBuffer, Length, NullCount, 0)); }
public TArray Build(MemoryAllocator allocator = default) { ValueOffsets.Append(Offset); ArrowBuffer validityBuffer = NullCount > 0 ? ValidityBuffer.Build(allocator).ValueBuffer : ArrowBuffer.Empty; var data = new ArrayData(DataType, ValueOffsets.Length - 1, NullCount, 0, new[] { validityBuffer, ValueOffsets.Build(allocator), ValueBuffer.Build(allocator) }); return(Build(data)); }
/// <summary> /// Build an Arrow array from the appended contents so far. /// </summary> /// <param name="allocator">Optional memory allocator.</param> /// <returns>Returns an array of type <typeparamref name="TArray"/>.</returns> public TArray Build(MemoryAllocator allocator = default) { var bufs = new[] { NullCount > 0 ? ValidityBuffer.Build(allocator) : ArrowBuffer.Empty, ValueOffsets.Build(allocator), ValueBuffer.Build(allocator), }; var data = new ArrayData( DataType, length: Length, NullCount, offset: 0, bufs); return(Build(data)); }