Class NumericArrayFrameColumnWriter

  • All Implemented Interfaces:
    Closeable, AutoCloseable, FrameColumnWriter
    Direct Known Subclasses:
    DoubleArrayFrameColumnWriter, FloatArrayFrameColumnWriter, LongArrayFrameColumnWriter

    public abstract class NumericArrayFrameColumnWriter
    extends Object
    implements FrameColumnWriter
    Parent class for the family of writers writing numeric arrays in columnar frames. Since the numeric primitives are fixed width, we don't need to store the width of each element. The memory layout of a column written by this writer is as follows: n : Total number of rows k : Total number of elements in all the rows, cumulative | Section | Length of the section | Denotion | |---------|-----------------------|--------------------------------------------------------------------------------------| | 0 | 1 | typeCode | | 1 | n * Integer.BYTES | n integers, where i-th integer represents the cumulative length of the array | | 2 | k * Byte.BYTES | k bytes, where i-th byte represent whether the i-th value from the start is null | | 3 | k * ELEMENT_SIZE | k values, each representing the element, or null equivalent value (e.g 0 for double) | Note on cumulative lengths stored in section 1: Cumulative lengths are stored so that its fast to offset into the elements of the array. We also use negative cumulative length to denote that the array itself is null (as opposed to individual elements being null, which we store in section 2)