@DeveloperApi
public class ColumnarBatch
extends Object
implements AutoCloseable
Constructor and Description |
---|
ColumnarBatch(ColumnVector[] columns) |
ColumnarBatch(ColumnVector[] columns,
int numRows)
Create a new batch from existing column vectors.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Called to close all the columns in this batch.
|
void |
closeIfFreeable()
Called to close all the columns if their resources are freeable between batches.
|
ColumnVector |
column(int ordinal)
Returns the column at `ordinal`.
|
org.apache.spark.sql.catalyst.InternalRow |
getRow(int rowId)
Returns the row in this batch at `rowId`.
|
int |
numCols()
Returns the number of columns that make up this batch.
|
int |
numRows()
Returns the number of rows for read, including filtered rows.
|
java.util.Iterator<org.apache.spark.sql.catalyst.InternalRow> |
rowIterator()
Returns an iterator over the rows in this batch.
|
void |
setNumRows(int numRows)
Sets the number of rows in this batch.
|
public ColumnarBatch(ColumnVector[] columns)
public ColumnarBatch(ColumnVector[] columns, int numRows)
columns
- The columns of this batchnumRows
- The number of rows in this batchpublic void close()
close
in interface AutoCloseable
public void closeIfFreeable()
public java.util.Iterator<org.apache.spark.sql.catalyst.InternalRow> rowIterator()
public void setNumRows(int numRows)
public int numCols()
public int numRows()
public ColumnVector column(int ordinal)
public org.apache.spark.sql.catalyst.InternalRow getRow(int rowId)