Class DataTableImplV4

  • All Implemented Interfaces:
    DataTable

    @Evolving
    public class DataTableImplV4
    extends Object
    implements DataTable
    Datatable V4 Implementation is a wrapper around the Row-based data block.
    • Field Detail

      • _errCodeToExceptionMap

        protected Map<Integer,​String> _errCodeToExceptionMap
      • _numRows

        protected int _numRows
      • _numColumns

        protected int _numColumns
      • _fixDataSize

        protected int _fixDataSize
      • _stringDictionary

        protected String[] _stringDictionary
      • _fixedSizeDataBytes

        protected byte[] _fixedSizeDataBytes
      • _fixedSizeData

        protected ByteBuffer _fixedSizeData
      • _variableSizeDataBytes

        protected byte[] _variableSizeDataBytes
      • _variableSizeData

        protected ByteBuffer _variableSizeData
      • _columnOffsets

        protected int[] _columnOffsets
      • _rowSizeInBytes

        protected int _rowSizeInBytes
    • Constructor Detail

      • DataTableImplV4

        public DataTableImplV4()
      • DataTableImplV4

        public DataTableImplV4​(int numRows,
                               DataSchema dataSchema,
                               String[] stringDictionary,
                               byte[] fixedSizeDataBytes,
                               byte[] variableSizeDataBytes)
    • Method Detail

      • getInt

        public int getInt​(int rowId,
                          int colId)
        Specified by:
        getInt in interface DataTable
      • getLong

        public long getLong​(int rowId,
                            int colId)
        Specified by:
        getLong in interface DataTable
      • getFloat

        public float getFloat​(int rowId,
                              int colId)
        Specified by:
        getFloat in interface DataTable
      • getDouble

        public double getDouble​(int rowId,
                                int colId)
        Specified by:
        getDouble in interface DataTable
      • getIntArray

        public int[] getIntArray​(int rowId,
                                 int colId)
        Specified by:
        getIntArray in interface DataTable
      • getLongArray

        public long[] getLongArray​(int rowId,
                                   int colId)
        Specified by:
        getLongArray in interface DataTable
      • getFloatArray

        public float[] getFloatArray​(int rowId,
                                     int colId)
        Specified by:
        getFloatArray in interface DataTable
      • getDoubleArray

        public double[] getDoubleArray​(int rowId,
                                       int colId)
        Specified by:
        getDoubleArray in interface DataTable
      • getNullRowIds

        @Nullable
        public org.roaringbitmap.RoaringBitmap getNullRowIds​(int colId)
        Specified by:
        getNullRowIds in interface DataTable
      • serializeStringDictionary

        protected byte[] serializeStringDictionary()
                                            throws IOException
        Helper method to serialize dictionary map.
        Throws:
        IOException
      • computeBlockObjectConstants

        protected void computeBlockObjectConstants()
      • getOffsetInFixedBuffer

        protected int getOffsetInFixedBuffer​(int rowId,
                                             int colId)
        return the offset in _fixedSizeDataBytes of the row/column ID.
        Parameters:
        rowId - row ID
        colId - column ID
        Returns:
        the offset in the fixed size buffer for the row/columnID.
      • positionOffsetInVariableBufferAndGetLength

        protected int positionOffsetInVariableBufferAndGetLength​(int rowId,
                                                                 int colId)
        position the _variableSizeDataBytes to the corresponding row/column ID. and return the length of bytes to extract from the variable size buffer.
        Parameters:
        rowId - row ID
        colId - column ID
        Returns:
        the length to extract from variable size buffer.
      • getRowSizeInBytes

        public int getRowSizeInBytes()