Arrow Utilities
This page documents the general-purpose Arrow inspection helpers exported by
@luma.gl/arrow.
These helpers operate on Apache Arrow tables, record batches, vectors, and data chunks before or alongside GPU upload. For shader-facing upload and binding workflows, see Supported Arrow Types.
getArrowPaths
getArrowPaths(arrowObject): string[]
Returns all leaf column paths in an Arrow object. Nested Struct fields are
reported with dot-separated paths.
Accepted inputs:
| Input | Behavior |
|---|---|
arrow.Table | Reads paths from the table's top-level struct data |
arrow.RecordBatch | Reads paths from the record batch data |
arrow.Vector | Reads paths from the vector data |
arrow.Data | Reads paths from the data node directly |
Example:
import {getArrowPaths} from '@luma.gl/arrow';
const paths = getArrowPaths(table);
// ['positions', 'properties.color']
getArrowDataByPath
getArrowDataByPath(arrowObject, columnPath): arrow.Data
Returns the Arrow Data node at a dot-separated leaf column path.
Behavior:
- accepts
arrow.Table,arrow.RecordBatch,arrow.Vector, orarrow.Data; - traverses nested
Structfields by name; - throws if an intermediate path segment is not a struct;
- throws if the path does not exist;
- throws if the resolved path is still a struct instead of a leaf data node.
Example:
import {getArrowDataByPath} from '@luma.gl/arrow';
const colorData = getArrowDataByPath(table, 'properties.color');
getArrowVectorByPath
getArrowVectorByPath(arrowTable, columnPath): arrow.Vector
Returns the Arrow Vector at a dot-separated leaf column path in a table.
Behavior:
- accepts an
arrow.Table; - traverses nested
Structfields by name; - throws if an intermediate path segment is not a struct;
- throws if the path does not exist;
- throws if the resolved path is still a struct instead of a leaf vector.
Example:
import {getArrowVectorByPath} from '@luma.gl/arrow';
const colorVector = getArrowVectorByPath(table, 'properties.color');
getArrowListNestingLevel
getArrowListNestingLevel(data): number
Returns the number of top-level Arrow List wrappers around a data node.
In the current implementation, this helper distinguishes a top-level list from non-list data:
| Data type | Result |
|---|---|
List<T> | 1 |
| Non-list data | 0 |
Example:
import {getArrowListNestingLevel} from '@luma.gl/arrow';
const nestingLevel = getArrowListNestingLevel(pathData);