Class TransferableBlock
- java.lang.Object
-
- org.apache.pinot.query.runtime.blocks.TransferableBlock
-
-
Constructor Summary
Constructors Constructor Description TransferableBlock(List<Object[]> container, DataSchema dataSchema, DataBlock.Type type)TransferableBlock(DataBlock dataBlock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddException(int errCode, String errMsg)voidaddException(ProcessingException processingException)List<Object[]>getContainer()Retrieve the extracted_containerof the transferable block.DataBlockgetDataBlock()Retrieve the binary-packed version of the data block.DataSchemagetDataSchema()Map<Integer,String>getExceptions()intgetNumRows()Map<String,OperatorStats>getResultMetadata()DataBlock.TypegetType()Return the type of block (one of ROW, COLUMNAR, or METADATA).booleanisDataBlock()booleanisEndOfStreamBlock()Return whether a transferable block is at the end of a stream.booleanisErrorBlock()Return whether a transferable block contains exception.booleanisSuccessfulEndOfStreamBlock()StringtoString()
-
-
-
Constructor Detail
-
TransferableBlock
public TransferableBlock(List<Object[]> container, DataSchema dataSchema, DataBlock.Type type)
-
TransferableBlock
public TransferableBlock(DataBlock dataBlock)
-
-
Method Detail
-
getResultMetadata
public Map<String,OperatorStats> getResultMetadata()
-
getNumRows
public int getNumRows()
-
getDataSchema
public DataSchema getDataSchema()
-
getContainer
public List<Object[]> getContainer()
Retrieve the extracted_containerof the transferable block. If not already constructed. It will useDataBlockUtilsto extract the row/columnar data from the binary-packed format.- Returns:
- data container.
-
getDataBlock
public DataBlock getDataBlock()
Retrieve the binary-packed version of the data block. If not already constructed. It will useDataBlockBuilderto construct the binary-packed format from the_container.- Returns:
- data block.
-
addException
public void addException(ProcessingException processingException)
-
addException
public void addException(int errCode, String errMsg)
-
getType
public DataBlock.Type getType()
Return the type of block (one of ROW, COLUMNAR, or METADATA).- Returns:
- return type of block
-
isEndOfStreamBlock
public boolean isEndOfStreamBlock()
Return whether a transferable block is at the end of a stream.End of stream is different from data block with 0-rows. which can indicate that one partition of the execution returns no rows. but that doesn't mean the rest of the partitions are also finished.
When an exception is caught within a stream, no matter how many outstanding data is pending to be received, it is considered end of stream because the exception should bubble up immediately.
- Returns:
- whether this block is the end of stream.
-
isSuccessfulEndOfStreamBlock
public boolean isSuccessfulEndOfStreamBlock()
- Returns:
- true when the block is a real end of stream block instead of error block.
-
isDataBlock
public boolean isDataBlock()
-
isErrorBlock
public boolean isErrorBlock()
Return whether a transferable block contains exception.- Returns:
- true if contains exception.
-
-