Interface ValueBlock

All Superinterfaces:
Block
All Known Implementing Classes:
ArrayBlock, ByteArrayBlock, Fixed12Block, Int128ArrayBlock, IntArrayBlock, LongArrayBlock, MapBlock, RowBlock, ShortArrayBlock, VariableWidthBlock

public non-sealed interface ValueBlock extends Block
  • Method Details

    • copyPositions

      ValueBlock copyPositions(int[] positions, int offset, int length)
      Description copied from interface: Block
      Returns a block containing the specified positions. Positions to copy are stored in a subarray within positions array that starts at offset and has length of length. All specified positions must be valid for this block.

      The returned block must be a compact representation of the original block.

      Specified by:
      copyPositions in interface Block
    • getRegion

      ValueBlock getRegion(int positionOffset, int length)
      Description copied from interface: Block
      Returns 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.

      Specified by:
      getRegion in interface Block
    • copyRegion

      ValueBlock copyRegion(int position, int length)
      Description copied from interface: Block
      Returns 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:
      copyRegion in interface Block
    • copyWithAppendedNull

      ValueBlock copyWithAppendedNull()
      Description copied from interface: Block
      Returns 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 built Block instances i.e. not on in-progress block builders.
      Specified by:
      copyWithAppendedNull in interface Block
    • getUnderlyingValueBlock

      default ValueBlock getUnderlyingValueBlock()
      Description copied from interface: Block
      Returns the underlying value block underlying this block.
      Specified by:
      getUnderlyingValueBlock in interface Block
    • getUnderlyingValuePosition

      default int getUnderlyingValuePosition(int position)
      Description copied from interface: Block
      Returns the position in the underlying value block corresponding to the specified position in this block.
      Specified by:
      getUnderlyingValuePosition in interface Block
    • getNulls

      @Experimental(eta="2025-01-01") Optional<ByteArrayBlock> getNulls()
      Returns a ByteArrayBlock specifying whether the current positions in the Block contain a NULL. Returns Optional.empty() when there are no NULLs in the Block. The returned ByteArrayBlock must not contain NULL values.