Package ai.rapids.cudf
Class ArrowColumnBuilder
java.lang.Object
ai.rapids.cudf.ArrowColumnBuilder
- All Implemented Interfaces:
AutoCloseable
Column builder from Arrow data. This builder takes in byte buffers referencing
Arrow data and allows efficient building of CUDF ColumnVectors from that Arrow data.
The caller can add multiple batches where each batch corresponds to Arrow data
and those batches get concatenated together after being converted to CUDF
ColumnVectors.
This currently only supports primitive types and Strings, Decimals and nested types
such as list and struct are not supported.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch
(long rows, long nullCount, ByteBuffer data, ByteBuffer validity, ByteBuffer offsets) Add an Arrow buffer.final ColumnVector
Create the immutable ColumnVector, copied to the device based on the Arrow data.void
close()
toString()
-
Constructor Details
-
ArrowColumnBuilder
-
-
Method Details
-
addBatch
public void addBatch(long rows, long nullCount, ByteBuffer data, ByteBuffer validity, ByteBuffer offsets) Add an Arrow buffer. This API allows you to add multiple if you want them combined into a single ColumnVector. Note, this takes all data, validity, and offsets buffers, but they may not all be needed based on the data type. The buffer should be null if its not used for that type. This API only supports primitive types and Strings, Decimals and nested types such as list and struct are not supported.- Parameters:
rows
- - number of rows in this Arrow buffernullCount
- - number of null values in this Arrow bufferdata
- - ByteBuffer of the Arrow data buffervalidity
- - ByteBuffer of the Arrow validity bufferoffsets
- - ByteBuffer of the Arrow offsets buffer
-
buildAndPutOnDevice
Create the immutable ColumnVector, copied to the device based on the Arrow data.- Returns:
- - new ColumnVector
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
toString
-