Class DataBlockUtils
- java.lang.Object
-
- org.apache.pinot.common.datablock.DataBlockUtils
-
public final class DataBlockUtils extends Object
-
-
Method Summary
Modifier and Type Method Description static intcomputeColumnOffsets(DataSchema dataSchema, int[] columnOffsets)Given aDataSchema, compute each column's offset and fill them into the passed in array, then return the row size in bytes.static voidcomputeColumnSizeInBytes(DataSchema dataSchema, int[] columnSizes)Given aDataSchema, compute each column's size and fill them into the passed in array.static org.roaringbitmap.RoaringBitmap[]extractNullBitmaps(DataBlock dataBlock)static Object[]extractRowFromDataBlock(DataBlock dataBlock, int rowId, DataSchema.ColumnDataType[] dataTypes, org.roaringbitmap.RoaringBitmap[] nullBitmaps)static List<Object[]>extractRows(DataBlock dataBlock)static DataBlockgetDataBlock(ByteBuffer byteBuffer)static MetadataBlockgetEndOfStreamDataBlock()static MetadataBlockgetErrorDataBlock(Exception e)static MetadataBlockgetErrorDataBlock(Map<Integer,String> exceptions)static MetadataBlockgetNoOpBlock()
-
-
-
Method Detail
-
getErrorDataBlock
public static MetadataBlock getErrorDataBlock(Exception e)
-
getErrorDataBlock
public static MetadataBlock getErrorDataBlock(Map<Integer,String> exceptions)
-
getEndOfStreamDataBlock
public static MetadataBlock getEndOfStreamDataBlock()
-
getNoOpBlock
public static MetadataBlock getNoOpBlock()
-
getDataBlock
public static DataBlock getDataBlock(ByteBuffer byteBuffer) throws IOException
- Throws:
IOException
-
computeColumnOffsets
public static int computeColumnOffsets(DataSchema dataSchema, int[] columnOffsets)
Given aDataSchema, compute each column's offset and fill them into the passed in array, then return the row size in bytes.- Parameters:
dataSchema- data schema.columnOffsets- array of column offsets.- Returns:
- row size in bytes.
-
computeColumnSizeInBytes
public static void computeColumnSizeInBytes(DataSchema dataSchema, int[] columnSizes)
Given aDataSchema, compute each column's size and fill them into the passed in array.- Parameters:
dataSchema- data schema.columnSizes- array of column size.
-
extractNullBitmaps
public static org.roaringbitmap.RoaringBitmap[] extractNullBitmaps(DataBlock dataBlock)
-
extractRowFromDataBlock
public static Object[] extractRowFromDataBlock(DataBlock dataBlock, int rowId, DataSchema.ColumnDataType[] dataTypes, org.roaringbitmap.RoaringBitmap[] nullBitmaps)
-
-