Class BaseDataTable
- java.lang.Object
-
- org.apache.pinot.common.datatable.BaseDataTable
-
- All Implemented Interfaces:
DataTable
- Direct Known Subclasses:
DataTableImplV2,DataTableImplV3
public abstract class BaseDataTable extends Object implements DataTable
Base implementation of the DataTable interface.
-
-
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<String,Map<Integer,String>>_dictionaryMapprotected ByteBuffer_fixedSizeDataprotected byte[]_fixedSizeDataBytesprotected Map<String,String>_metadataprotected int_numColumnsprotected int_numRowsprotected int_rowSizeInBytesprotected ByteBuffer_variableSizeDataprotected byte[]_variableSizeDataBytes-
Fields inherited from interface org.apache.pinot.common.datatable.DataTable
EXCEPTION_METADATA_KEY
-
-
Constructor Summary
Constructors Constructor Description BaseDataTable()Construct empty data table.BaseDataTable(int numRows, DataSchema dataSchema, Map<String,Map<Integer,String>> dictionaryMap, byte[] fixedSizeDataBytes, byte[] variableSizeDataBytes)
-
Method Summary
Modifier and Type Method Description protected Map<String,Map<Integer,String>>deserializeDictionaryMap(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)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()StringgetString(int rowId, int colId)String[]getStringArray(int rowId, int colId)protected byte[]serializeDictionaryMap()Helper method to serialize dictionary map.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.common.datatable.DataTable
addException, addException, getExceptions, getVersion, toBytes, toDataOnlyDataTable, toMetadataOnlyDataTable
-
-
-
-
Field Detail
-
_numRows
protected int _numRows
-
_numColumns
protected int _numColumns
-
_dataSchema
protected DataSchema _dataSchema
-
_columnOffsets
protected int[] _columnOffsets
-
_rowSizeInBytes
protected int _rowSizeInBytes
-
_fixedSizeDataBytes
protected byte[] _fixedSizeDataBytes
-
_fixedSizeData
protected ByteBuffer _fixedSizeData
-
_variableSizeDataBytes
protected byte[] _variableSizeDataBytes
-
_variableSizeData
protected ByteBuffer _variableSizeData
-
-
Method Detail
-
serializeDictionaryMap
protected byte[] serializeDictionaryMap() throws IOExceptionHelper method to serialize dictionary map.- Throws:
IOException
-
deserializeDictionaryMap
protected Map<String,Map<Integer,String>> deserializeDictionaryMap(ByteBuffer buffer) throws IOException
Helper method to deserialize dictionary map.- Throws:
IOException
-
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
-
-