Top-Level | Data Types | Schema | Table | Column |
A data column. A column provides a view over one or more value batches, each corresponding to part of an Arrow record batch. The Column class supports random access to column values by integer index using the at
method; however, extracting arrays using toArray
may provide more performant means of bulk access and scanning.
# Column.constructor(data[, type])
Create a new column with the given data batches.
Batch[]
): The column data batches.DataType
): The column data type. If not specified, the type is extracted from the data batches. This argument is only needed to ensure correct types for “empty” columns without any data.# Column.type
The column data type.
# Column.length
The column length (number of rows).
# Column.nullCount
The count of null values in the column.
# Column.data
An array of column data batches.
# Column.at(index)
Return the column value at the given index. The value type is determined by the column data type and extraction options; see the data types documentation for more.
If a column has multiple batches, this method performs binary search over the batch lengths to determine the batch from which to retrieve the value. The search makes lookup less efficient than a standard array access. If making multiple full scans of a column, consider extracting an array via toArray()
.
number
): The row index.# Column.get(index)
Return the column value at the given index. This method is the same as at
and is provided for better compatibility with Apache Arrow JS.
# Column.toArray()
Extract column values into a single array instance. The value type is determined by the column data type and extraction options; see the data types documentation for more. When possible, a zero-copy subarray of the input Arrow data is returned. A typed array is used if possible. If a column contains null
values, a standard Array
is created and populated.
# Column[Symbol.iterator]()
Return an iterator over the values in this column. The value type is determined by the column data type and extraction options; see the data types documentation for more.