Package org.apache.arrow.vector.table
Class Table
java.lang.Object
org.apache.arrow.vector.table.BaseTable
org.apache.arrow.vector.table.Table
- All Implemented Interfaces:
AutoCloseable
,Iterable<Row>
Table is an immutable tabular data structure.
See VectorSchemaRoot
for batch processing use cases
This API is EXPERIMENTAL.
-
Field Summary
Fields inherited from class org.apache.arrow.vector.table.BaseTable
dictionaryProvider, fieldVectors, fieldVectorsMap, rowCount, schema
-
Constructor Summary
ConstructorDescriptionTable
(Iterable<FieldVector> vectors) Constructs new instance containing each of the given vectors.Table
(List<FieldVector> fieldVectors) Constructs a new instance with the number of rows set to the value count of the first FieldVector.Table
(List<FieldVector> fieldVectors, int rowCount) Constructs a new instance.Table
(List<FieldVector> fieldVectors, int rowCount, DictionaryProvider provider) Constructs a new instance.Table
(VectorSchemaRoot vsr) Constructs a new instance containing the data from the argument. -
Method Summary
Modifier and TypeMethodDescriptionaddVector
(int index, FieldVector vector) Returns a new Table created by adding the given vector to the vectors in this Table.copy()
Returns a deep copy of this table.iterator()
Returns a Row iterator for this Table.static Table
of
(FieldVector... vectors) Constructs a new instance from vectors.removeVector
(int index) Returns a new Table created by removing the selected Vector from this Table.slice
(int index) Slice this table from desired index.slice
(int index, int length) Slice this table at desired index and length.Methods inherited from class org.apache.arrow.vector.table.BaseTable
close, contentToTSVString, decode, encode, getDictionaryProvider, getField, getReader, getReader, getReader, getRowCount, getSchema, getVectorCopy, getVectorCopy, getVectorCount, immutableRow, isRowDeleted, toVectorSchemaRoot
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Table
Constructs new instance containing each of the given vectors. -
Table
Constructs a new instance with the number of rows set to the value count of the first FieldVector.All vectors must have the same value count. Although this is not checked, inconsistent counts may lead to exceptions or other undefined behavior later.
- Parameters:
fieldVectors
- The data vectors (must be equal in size tofields
.
-
Table
Constructs a new instance.- Parameters:
fieldVectors
- The data vectors.rowCount
- The number of rows
-
Table
Constructs a new instance.- Parameters:
fieldVectors
- The data vectors.rowCount
- The number of rowsprovider
- A dictionary provider. May be null if none of the vectors is dictionary encoded
-
Table
Constructs a new instance containing the data from the argument. Vectors are shared between the Table and VectorSchemaRoot. Direct modification of those vectors is unsafe and should be avoided.- Parameters:
vsr
- The VectorSchemaRoot providing data for this Table
-
-
Method Details
-
of
Constructs a new instance from vectors. -
copy
Returns a deep copy of this table. -
addVector
Returns a new Table created by adding the given vector to the vectors in this Table.- Parameters:
index
- field indexvector
- vector to be added.- Returns:
- out a new Table with vector added
-
removeVector
Returns a new Table created by removing the selected Vector from this Table.- Parameters:
index
- field index- Returns:
- out a new Table with vector removed
-
slice
Slice this table from desired index. Memory is NOT transferred from the vectors in this table to new vectors in the target table. This table is unchanged.- Parameters:
index
- start position of the slice- Returns:
- the sliced table
-
slice
Slice this table at desired index and length. Memory is NOT transferred from the vectors in this table to new vectors in the target table. This table is unchanged.- Parameters:
index
- start position of the slicelength
- length of the slice- Returns:
- the sliced table
-
iterator
Returns a Row iterator for this Table.
-