Class AbstractVariableWidthType

java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.AbstractVariableWidthType
All Implemented Interfaces:
Type, VariableWidthType
Direct Known Subclasses:
CharType, HyperLogLogType, P4HyperLogLogType, QuantileDigestType, VarbinaryType, VarcharType

public abstract class AbstractVariableWidthType extends AbstractType implements VariableWidthType
  • Field Details

  • Constructor Details

    • AbstractVariableWidthType

      protected AbstractVariableWidthType(TypeSignature signature, Class<?> javaType)
  • Method Details

    • createBlockBuilder

      public VariableWidthBlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
      Description copied from interface: Type
      Creates the preferred block builder for this type. This is the builder used to store values after an expression projection within the query.
      Specified by:
      createBlockBuilder in interface Type
    • createBlockBuilder

      public VariableWidthBlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
      Description copied from interface: Type
      Creates the preferred block builder for this type. This is the builder used to store values after an expression projection within the query.
      Specified by:
      createBlockBuilder in interface Type
    • appendTo

      public void appendTo(Block block, int position, BlockBuilder blockBuilder)
      Description copied from interface: Type
      Append the value at position in block to blockBuilder.
      Specified by:
      appendTo in interface Type
    • getTypeOperatorDeclaration

      public TypeOperatorDeclaration getTypeOperatorDeclaration(TypeOperators typeOperators)
      Description copied from interface: Type
      Gets the declared type specific operators for this type.
      Specified by:
      getTypeOperatorDeclaration in interface Type
    • getFlatFixedSize

      public int getFlatFixedSize()
      Description copied from interface: Type
      Returns the fixed size of this type when written to a flat buffer.
      Specified by:
      getFlatFixedSize in interface Type
    • isFlatVariableWidth

      public boolean isFlatVariableWidth()
      Description copied from interface: Type
      Returns true if this type is variable width when written to a flat buffer.
      Specified by:
      isFlatVariableWidth in interface Type
    • getFlatVariableWidthSize

      public int getFlatVariableWidthSize(Block block, int position)
      Description copied from interface: Type
      Returns the variable width size of the value at the specified position when written to a flat buffer.
      Specified by:
      getFlatVariableWidthSize in interface Type
    • relocateFlatVariableWidthOffsets

      public int relocateFlatVariableWidthOffsets(byte[] fixedSizeSlice, int fixedSizeOffset, byte[] variableSizeSlice, int variableSizeOffset)
      Description copied from interface: Type
      Update the variable width offsets recorded in the value. This method is called after the value has been moved to a new location, and therefore the offsets need to be updated. Returns the length of the variable width data, so container types can update their offsets.
      Specified by:
      relocateFlatVariableWidthOffsets in interface Type
      Returns:
      the length of the variable width data