Class VectorUnloader

java.lang.Object
org.apache.arrow.vector.VectorUnloader

public class VectorUnloader extends Object
Helper class that handles converting a VectorSchemaRoot to a ArrowRecordBatch.
  • Constructor Details

    • VectorUnloader

      public VectorUnloader(VectorSchemaRoot root)
      Constructs a new instance of the given set of vectors.
    • VectorUnloader

      public VectorUnloader(VectorSchemaRoot root, boolean includeNullCount, boolean alignBuffers)
      Constructs a new instance.
      Parameters:
      root - The set of vectors to serialize to an ArrowRecordBatch.
      includeNullCount - Controls whether null count is copied to the ArrowRecordBatch
      alignBuffers - Controls if buffers get aligned to 8-byte boundaries.
    • VectorUnloader

      public VectorUnloader(VectorSchemaRoot root, boolean includeNullCount, CompressionCodec codec, boolean alignBuffers)
      Constructs a new instance.
      Parameters:
      root - The set of vectors to serialize to an ArrowRecordBatch.
      includeNullCount - Controls whether null count is copied to the ArrowRecordBatch
      codec - the codec for compressing data. If it is null, then no compression is needed.
      alignBuffers - Controls if buffers get aligned to 8-byte boundaries.
  • Method Details

    • getRecordBatch

      public ArrowRecordBatch getRecordBatch()
      Performs the depth first traversal of the Vectors to create an ArrowRecordBatch suitable for serialization.

      A variable-width, list or map vector whose offsets start past zero, or whose child vector holds elements past its last offset, as one imported through the C Data interface from a sliced array does, is written as the values between its first and last offset, with the offsets re-based to start at zero. Vectors with a union, view or extension vector at or below them are written as they are.