Class DataTableImplV4
- java.lang.Object
-
- org.apache.pinot.common.datatable.DataTableImplV4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pinot.common.datatable.DataTable
DataTable.CustomObject, DataTable.MetadataKey, DataTable.MetadataValueType
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]_columnOffsetsprotected DataSchema_dataSchemaprotected Map<Integer,String>_errCodeToExceptionMapprotected int_fixDataSizeprotected ByteBuffer_fixedSizeDataprotected byte[]_fixedSizeDataBytesprotected Map<String,String>_metadataprotected int_numColumnsprotected int_numRowsprotected int_rowSizeInBytesprotected String[]_stringDictionaryprotected ByteBuffer_variableSizeDataprotected byte[]_variableSizeDataBytesprotected static intHEADER_SIZE-
Fields inherited from interface org.apache.pinot.common.datatable.DataTable
EXCEPTION_METADATA_KEY
-
-
Constructor Summary
Constructors Constructor Description DataTableImplV4()DataTableImplV4(int numRows, DataSchema dataSchema, String[] stringDictionary, byte[] fixedSizeDataBytes, byte[] variableSizeDataBytes)DataTableImplV4(ByteBuffer byteBuffer)
-
Method Summary
Modifier and Type Method Description voidaddException(int errCode, String errMsg)voidaddException(ProcessingException processingException)protected voidcomputeBlockObjectConstants()protected String[]deserializeStringDictionary(ByteBuffer buffer)Helper method to deserialize dictionary map.BigDecimalgetBigDecimal(int rowId, int colId)ByteArraygetBytes(int rowId, int colId)DataTable.CustomObjectgetCustomObject(int rowId, int colId)DataSchemagetDataSchema()doublegetDouble(int rowId, int colId)double[]getDoubleArray(int rowId, int colId)Map<Integer,String>getExceptions()floatgetFloat(int rowId, int colId)float[]getFloatArray(int rowId, int colId)intgetInt(int rowId, int colId)int[]getIntArray(int rowId, int colId)longgetLong(int rowId, int colId)long[]getLongArray(int rowId, int colId)Map<String,String>getMetadata()org.roaringbitmap.RoaringBitmapgetNullRowIds(int colId)intgetNumberOfRows()protected intgetOffsetInFixedBuffer(int rowId, int colId)return the offset in_fixedSizeDataBytesof the row/column ID.intgetRowSizeInBytes()StringgetString(int rowId, int colId)String[]getStringArray(int rowId, int colId)intgetVersion()protected intpositionOffsetInVariableBufferAndGetLength(int rowId, int colId)position the_variableSizeDataBytesto the corresponding row/column ID.protected byte[]serializeStringDictionary()Helper method to serialize dictionary map.byte[]toBytes()DataTabletoDataOnlyDataTable()DataTabletoMetadataOnlyDataTable()StringtoString()
-
-
-
Field Detail
-
HEADER_SIZE
protected static final int HEADER_SIZE
- See Also:
- Constant Field Values
-
_numRows
protected int _numRows
-
_numColumns
protected int _numColumns
-
_fixDataSize
protected int _fixDataSize
-
_dataSchema
protected DataSchema _dataSchema
-
_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)
-
DataTableImplV4
public DataTableImplV4(ByteBuffer byteBuffer) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getVersion
public int getVersion()
- Specified by:
getVersionin interfaceDataTable
-
getMetadata
public Map<String,String> getMetadata()
- Specified by:
getMetadatain interfaceDataTable
-
getDataSchema
public DataSchema getDataSchema()
- Specified by:
getDataSchemain interfaceDataTable
-
getNumberOfRows
public int getNumberOfRows()
- Specified by:
getNumberOfRowsin interfaceDataTable
-
getDouble
public double getDouble(int rowId, int colId)
-
getBigDecimal
public BigDecimal getBigDecimal(int rowId, int colId)
- Specified by:
getBigDecimalin interfaceDataTable
-
getString
public String getString(int rowId, int colId)
-
getBytes
public ByteArray getBytes(int rowId, int colId)
-
getIntArray
public int[] getIntArray(int rowId, int colId)- Specified by:
getIntArrayin interfaceDataTable
-
getLongArray
public long[] getLongArray(int rowId, int colId)- Specified by:
getLongArrayin interfaceDataTable
-
getFloatArray
public float[] getFloatArray(int rowId, int colId)- Specified by:
getFloatArrayin interfaceDataTable
-
getDoubleArray
public double[] getDoubleArray(int rowId, int colId)- Specified by:
getDoubleArrayin interfaceDataTable
-
getStringArray
public String[] getStringArray(int rowId, int colId)
- Specified by:
getStringArrayin interfaceDataTable
-
getCustomObject
@Nullable public DataTable.CustomObject getCustomObject(int rowId, int colId)
- Specified by:
getCustomObjectin interfaceDataTable
-
getNullRowIds
@Nullable public org.roaringbitmap.RoaringBitmap getNullRowIds(int colId)
- Specified by:
getNullRowIdsin interfaceDataTable
-
serializeStringDictionary
protected byte[] serializeStringDictionary() throws IOExceptionHelper method to serialize dictionary map.- Throws:
IOException
-
deserializeStringDictionary
protected String[] deserializeStringDictionary(ByteBuffer buffer) throws IOException
Helper method to deserialize dictionary map.- Throws:
IOException
-
addException
public void addException(ProcessingException processingException)
- Specified by:
addExceptionin interfaceDataTable
-
addException
public void addException(int errCode, String errMsg)- Specified by:
addExceptionin interfaceDataTable
-
getExceptions
public Map<Integer,String> getExceptions()
- Specified by:
getExceptionsin interfaceDataTable
-
toBytes
public byte[] toBytes() throws IOException- Specified by:
toBytesin interfaceDataTable- Throws:
IOException
-
computeBlockObjectConstants
protected void computeBlockObjectConstants()
-
getOffsetInFixedBuffer
protected int getOffsetInFixedBuffer(int rowId, int colId)return the offset in_fixedSizeDataBytesof the row/column ID.- Parameters:
rowId- row IDcolId- column ID- Returns:
- the offset in the fixed size buffer for the row/columnID.
-
positionOffsetInVariableBufferAndGetLength
protected int positionOffsetInVariableBufferAndGetLength(int rowId, int colId)position the_variableSizeDataBytesto the corresponding row/column ID. and return the length of bytes to extract from the variable size buffer.- Parameters:
rowId- row IDcolId- column ID- Returns:
- the length to extract from variable size buffer.
-
toMetadataOnlyDataTable
public DataTable toMetadataOnlyDataTable()
- Specified by:
toMetadataOnlyDataTablein interfaceDataTable
-
toDataOnlyDataTable
public DataTable toDataOnlyDataTable()
- Specified by:
toDataOnlyDataTablein interfaceDataTable
-
getRowSizeInBytes
public int getRowSizeInBytes()
-
-