Also referred to as BaseVector
. An abstract base class for vector types.
Data<T>
(readonly)The underlying Data instance for this Vector.
The number of logical Vector children. Only applicable if the DataType of the Vector is one of the nested types (List, FixedSizeList, Struct, or Map).
The DataType that describes the elements in the Vector
The typeId
enum value of the type
instance
Number of elements in the Vector
Offset to the first element in the underlying data.
Stride between successive elements in the the underlying data.
The number of elements in the underlying data buffer that constitute a single logical value for the given type. The stride for all DataTypes is 1 unless noted here:
Decimal
types, the stride is 4.Date
types, the stride is 1 if the unit
is DateUnit.DAY, else 2.Int
, Interval
, or Time
types, the stride is 1 if bitWidth <= 32
, else 2.FixedSizeList
types, the stride is the listSize
property of the FixedSizeList
instance.FixedSizeBinary
types, the stride is the byteWidth
property of the FixedSizeBinary
instance.Number of null
values in this Vector
instance (null
values require a null map to be present).
Returns the name of the Vector
Returns the constructor of the underlying typed array for the values buffer as determined by this Vector's DataType.
Returns the underlying data buffer of the Vector, if applicable.
Returns the underlying typeIds buffer, if the Vector DataType is Union.
Returns the underlying validity bitmap buffer, if applicable.
Note: Since the validity bitmap is a Uint8Array of bits, it is not sliced when you call vector.slice()
. Instead, the vector.offset
property is updated on the returned Vector. Therefore, you must factor vector.offset
into the bit position if you wish to slice or read the null positions manually. See the implementation of BaseVector.isValid()
for an example of how this is done.
Returns the underlying valueOffsets buffer, if applicable. Only the List, Utf8, Binary, and DenseUnion DataTypes will have valueOffsets.
Data<R>
, children): Vector<R>
Returns a clone of the current Vector, using the supplied Data and optional children for the new clone. Does not copy any underlying buffers.
Vector<T>[]
)Returns a Chunked
vector that concatenates this Vector with the supplied other Vectors. Other Vectors must be the same type as this Vector.
Returns a zero-copy slice of this Vector. The begin and end arguments are handled the same way as JS' Array.prototype.slice
; they are clamped between 0 and vector.length
and wrap around when negative, e.g. slice(-1, 5)
or slice(5, -1)
Returns whether the supplied index is valid in the underlying validity bitmap.
<R extends DataType = any>
(index: number): Vector<R>
| nullReturns the inner Vector child if the DataType is one of the nested types (Map or Struct).
Returns a dense JS Array of the Vector values, with null sentinels in-place.