Constructing new Vector
instances is done through the static from()
methods
The Dictionary type is a special array type that enables one or more record batches in a file or stream to transmit integer indices referencing a shared dictionary containing the distinct values in the logical array. Later record batches reuse indices in earlier batches and add new ones as needed.
A Dictionary
is similar to a factor
in R or a pandas, or "Categorical" in Python. It is is often used with strings to save memory and improve performance.
Holds nested fields.
Bool Vectors |
---|
BoolVector |
Binary Vectors |
---|
BinaryVector |
Float Vectors |
---|
Float16Vector |
Float32Vector |
Float64Vector |
Iterable<Number>
): Float16Vector;Iterable<Number>
): Float16Vector;Iterable<Number>
): Float32Vector;Iterable<Number>
): Float64Vector;Since JS doesn't have half floats, Float16Vector
is backed by a Uint16Array
integer array. To make it practical to work with these arrays in JS, some extra methods are added.
Uint16Array
Returns a zero-copy view of the underlying Uint16Array
data.
Note: Avoids incurring extra compute or copies if you're calling toArray()
in order to create a buffer for something like WebGL, but makes it hard to use the returned data as floating point values in JS.
This method will convert values to 32 bit floats. Allocates a new Array.
This method will convert values to 64 bit floats. Allocates a new Array.
Int Vectors | Backing | Comments |
---|---|---|
Int8Vector | Int8Array | |
Int16Vector | Int16Array | |
Int32Vector | Int32Array | |
Int64Vector | Int32Array | 64-bit values stored as pairs of lo, hi 32-bit values for engines without BigInt support, extra methods available |
Uint8Vector | Uint8Array | |
Uint16Vector | Uint16Array | |
Uint32Vector | Uint32Array | |
Uint64Vector | Uint32Array | 64-bit values stored as pairs of lo, hi 32-bit values for engines without BigInt support, extra methods available |
Int32Array
Returns a zero-copy view of the underlying pairs of lo, hi
32-bit values as an Int32Array
. This Array's length is twice the logical length of the Int64Vector
.
BigInt64Array
Returns a zero-copy view of the underlying 64-bit integers as a BigInt64Array
. This Array has the samne length as the length of the original Int64Vector
.
Note: as of 03/2019, BigInt64Array
is only available in v8/Chrome. In JS runtimes without support for BigInt
, this method throws an unsupported error.
Uint32Array
Returns a zero-copy view of the underlying pairs of lo, hi
32-bit values as a Uint32Array
. This Array's length is twice the logical length of the Uint64Vector
.
BigUint64Array
Returns a zero-copy view of the underlying 64-bit integers as a BigUint64Array
. This Array has the samne length as the length of the original Uint64Vector
.
Note: as of 03/2019, BigUint64Array
is only available in v8/Chrome. In JS runtimes without support for BigInt
, this method throws an unsupported error.
Iterable<number>
): Int8Vector;Iterable<number>
): Int16Vector;Iterable<number>
): Int32Vector;Iterable<number>
): Int64Vector;Iterable<number>
): Uint8Vector;Iterable<number>
): Uint16Vector;Iterable<number>
): Uint32Vector;Iterable<number>
): Uint64Vector;Date Vectors | Backing | |
---|---|---|
DateDayVector | Int32Array | |
DateMillisecondVector | Int32Array | TBD - stride: 2? |