Skip to content

OnHeapColumnVector

OnHeapColumnVector is a concrete WritableColumnVector.

OnHeapColumnVector is <> when:

  • OnHeapColumnVector is requested to <> and <>

  • OrcColumnarBatchReader is requested to initBatch

=== [[allocateColumns]] Allocating Column Vectors -- allocateColumns Static Method

[source, java]

OnHeapColumnVector[] allocateColumns(int capacity, StructType schema) // <1> OnHeapColumnVector[] allocateColumns(int capacity, StructField[] fields)


<1> Simply converts StructType to StructField[] and calls the other allocateColumns

allocateColumns creates an array of OnHeapColumnVector for every field (to hold capacity number of elements of the data type per field).

allocateColumns is used when:

  • AggregateHashMap is created

  • InMemoryTableScanExec is requested to InMemoryTableScanExec.md#createAndDecompressColumn[createAndDecompressColumn]

  • VectorizedParquetRecordReader is requested to initBatch (with ON_HEAP memory mode)

  • OrcColumnarBatchReader is requested to initBatch (with ON_HEAP memory mode)

  • ColumnVectorUtils is requested to convert an iterator of rows into a single ColumnBatch (aka toBatch)

Creating Instance

OnHeapColumnVector takes the following when created:

  • [[capacity]] Number of elements to hold in a vector (aka capacity)
  • [[type]] Data type of the elements stored

When created, OnHeapColumnVector <> (for the given <>) and reset.

=== [[reserveInternal]] reserveInternal Method

[source, java]

void reserveInternal(int newCapacity)

reserveInternal is part of the WritableColumnVector abstraction.

reserveInternal...FIXME

=== [[reserveNewColumn]] reserveNewColumn Method

[source, java]

OnHeapColumnVector reserveNewColumn( int capacity, DataType type)


reserveNewColumn is part of the WritableColumnVector abstraction.

reserveNewColumn...FIXME


Last update: 2021-05-20