Class ArrowColumnBuilder

java.lang.Object
ai.rapids.cudf.ArrowColumnBuilder
All Implemented Interfaces:
AutoCloseable

public final class ArrowColumnBuilder extends Object implements 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 Details

  • 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 buffer
      nullCount - - number of null values in this Arrow buffer
      data - - ByteBuffer of the Arrow data buffer
      validity - - ByteBuffer of the Arrow validity buffer
      offsets - - ByteBuffer of the Arrow offsets buffer
    • buildAndPutOnDevice

      public final ColumnVector 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 interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object