Package io.trino.spi.block
Interface ValueBlock
- All Superinterfaces:
Block
- All Known Implementing Classes:
ArrayBlock,ByteArrayBlock,Fixed12Block,Int128ArrayBlock,IntArrayBlock,LongArrayBlock,MapBlock,RowBlock,ShortArrayBlock,VariableWidthBlock
-
Method Summary
Modifier and TypeMethodDescriptioncopyPositions(int[] positions, int offset, int length) Returns a block containing the specified positions.copyRegion(int position, int length) Returns a block starting at the specified position and extends for the specified length.Returns a block that contains a copy of the contents of the current block, and an appended null at the end.getRegion(int positionOffset, int length) Returns a block starting at the specified position and extends for the specified length.default ValueBlockReturns the underlying value block underlying this block.default intgetUnderlyingValuePosition(int position) Returns the position in the underlying value block corresponding to the specified position in this block.Methods inherited from interface io.trino.spi.block.Block
fixedSizeInBytesPerPosition, getByte, getChildren, getEncodingName, getEstimatedDataSizeForStats, getInt, getLoadedBlock, getLogicalSizeInBytes, getLong, getObject, getPositionCount, getPositions, getPositionsSizeInBytes, getRegionSizeInBytes, getRetainedSizeInBytes, getShort, getSingleValueBlock, getSizeInBytes, getSlice, getSliceLength, isLoaded, isNull, mayHaveNull, retainedBytesForEachPart
-
Method Details
-
copyPositions
Description copied from interface:BlockReturns a block containing the specified positions. Positions to copy are stored in a subarray withinpositionsarray that starts atoffsetand has length oflength. All specified positions must be valid for this block.The returned block must be a compact representation of the original block.
- Specified by:
copyPositionsin interfaceBlock
-
getRegion
Description copied from interface:BlockReturns a block starting at the specified position and extends for the specified length. The specified region must be entirely contained within this block.The region can be a view over this block. If this block is released the region block may also be released. If the region block is released this block may also be released.
-
copyRegion
Description copied from interface:BlockReturns a block starting at the specified position and extends for the specified length. The specified region must be entirely contained within this block.The region returned must be a compact representation of the original block, unless their internal representation will be exactly the same. This method is useful for operators that hold on to a range of values without holding on to the entire block.
- Specified by:
copyRegionin interfaceBlock
-
copyWithAppendedNull
ValueBlock copyWithAppendedNull()Description copied from interface:BlockReturns a block that contains a copy of the contents of the current block, and an appended null at the end. The original block will not be modified. The purpose of this method is to leverage the contents of a block and the structure of the implementation to efficiently produce a copy of the block with a NULL element inserted - so that it can be used as a dictionary. This method is expected to be invoked on completely builtBlockinstances i.e. not on in-progress block builders.- Specified by:
copyWithAppendedNullin interfaceBlock
-
getUnderlyingValueBlock
Description copied from interface:BlockReturns the underlying value block underlying this block.- Specified by:
getUnderlyingValueBlockin interfaceBlock
-
getUnderlyingValuePosition
default int getUnderlyingValuePosition(int position) Description copied from interface:BlockReturns the position in the underlying value block corresponding to the specified position in this block.- Specified by:
getUnderlyingValuePositionin interfaceBlock
-