示例#1
0
 protected BuilderBase(IArrowType dataType)
 {
     DataType       = dataType;
     ValueOffsets   = new ArrowBuffer.Builder <int>();
     ValueBuffer    = new ArrowBuffer.Builder <byte>();
     ValidityBuffer = new ArrowBuffer.BitmapBuilder();
 }
示例#2
0
 internal Builder(ListType dataType)
 {
     ValueBuilder = ArrowArrayBuilderFactory.Build(dataType.ValueDataType);
     ValueOffsetsBufferBuilder = new ArrowBuffer.Builder <int>();
     ValidityBufferBuilder     = new ArrowBuffer.BitmapBuilder();
     DataType = dataType;
 }
            private ArrowBuffer ConcatenateBitmapBuffer(int bufferIndex)
            {
                var builder = new ArrowBuffer.BitmapBuilder(_totalLength);

                foreach (ArrayData arrayData in _arrayDataList)
                {
                    int length = arrayData.Length;
                    ReadOnlySpan <byte> span = arrayData.Buffers[bufferIndex].Span;

                    for (int i = 0; i < length; i++)
                    {
                        builder.Append(span.IsEmpty || BitUtility.GetBit(span, i));
                    }
                }

                return(builder.Build(_allocator));
            }
示例#4
0
            protected BuilderBase(IArrowType dataType)
            {
                DataType       = dataType;
                ValueOffsets   = new ArrowBuffer.Builder <int>();
                ValueBuffer    = new ArrowBuffer.Builder <byte>();
                ValidityBuffer = new ArrowBuffer.BitmapBuilder();

                // From the docs:
                //
                // The offsets buffer contains length + 1 signed integers (either 32-bit or 64-bit, depending on the
                // logical type), which encode the start position of each slot in the data buffer. The length of the
                // value in each slot is computed using the difference between the offset at that slot’s index and the
                // subsequent offset.
                //
                // In this builder, we choose to append the first offset (zero) upon construction, and each trailing
                // offset is then added after each individual item has been appended.
                ValueOffsets.Append(this.Offset);
            }
示例#5
0
 public Builder()
 {
     ValueBuffer    = new ArrowBuffer.BitmapBuilder();
     ValidityBuffer = new ArrowBuffer.BitmapBuilder();
 }