Many arrow classes support the following methods:
toArray()- Typically returns a typed array.
toJSON()- Arrow JS types can be converted to JSON.
toString()- Arrow JS types can be converted to strings.
You can get a temporary object representing a row in a table.
const row = table.get(0);
Note that the
row does not retain the schema, so you'll either need to know the order of columns
row.get(0), or use the
More efficient is to get a column.
const column = table.getColumn('data');
The column can be chunked, so to get a contiguous (typed) array, call
const array = table.getColumn('columnName').toArray();
Note that if there are multiple chunks in the array, this will create a new typed array and copy the typed arrays in the chunks into that array.
A more efficient (zero-copy) way to get access to data (especially if the table has not been sliced or filtered) could be to walk through the chunks in each column and get the underlying typed array for that chunk.