flechette

Flechette API Reference

Top-Level Data Types Schema Table Column

Table Class

A table consists of named data columns (or ‘children’). To extract table data directly to JavaScript values, use toColumns() to produce an object that maps column names to extracted value arrays, or toArray() to extract an array of row objects. Tables are iterable, iterating over row objects. While toArray() and table iterators enable convenient use by tools that expect row objects, column-oriented processing is more efficient and thus recommended. Use getChild or getChildAt to access a specific Column.


# Table.constructor(schema, children[, useProxy])

Create a new table with the given schema and children columns. The column types and order must be consistent with the given schema. The tableFromArrays and tableFromColumns methods provide more convenient ways to construct a table.


# Table.numCols

The number of columns in the table.


# Table.numRows

The number of rows in the table.


# Table.getChildAt(index)

Return the child column at the given index position.


# Table.getChild(name)

Return the first child column with the given name.


# Table.selectAt(indices[, as])

Construct a new table containing only columns at the specified indices. The order of columns in the new table matches the order of input indices.


# Table.select(names[, as])

Construct a new table containing only columns with the specified names. If columns have duplicate names, the first (with lowest index) is used. The order of columns in the new table matches the order of input names.


# Table.at(index)

Return a row object for the given index. The type of object (standard object or row proxy object) is determined by the table useProxy constructor argument. The property values of the object are determined by the column data types and extraction options; see the data types documentation for more.


# Table.get(index)

Return a row object for the given index. This method is the same as at and is provided for better compatibility with Apache Arrow JS.


# Table.toColumns()

Return an object that maps column names to extracted value arrays. The values in each array are determined by the column data types and extraction options; see the data types documentation for more.


# Table.toArray()

Return an array of objects representing the rows of this table. The type of object (standard object or row proxy object) is determined by the table useProxy constructor argument. The property values of the object are determined by the column data types and extraction options; see the data types documentation for more.


# Table[Symbol.iterator]()

Return an iterator over row objects representing the rows of this table. The type of object (standard object or row proxy object) is determined by the table useProxy constructor argument. The property values of the object are determined by the column data types and extraction options; see the data types documentation for more.