Class VarcharType

All Implemented Interfaces:
Type, VariableWidthType

public final class VarcharType extends AbstractVariableWidthType
  • Field Details

  • Method Details

    • createUnboundedVarcharType

      public static VarcharType createUnboundedVarcharType()
    • createVarcharType

      public static VarcharType createVarcharType(int length)
    • getLength

      public Optional<Integer> getLength()
    • getBoundedLength

      public int getBoundedLength()
    • isUnbounded

      public boolean isUnbounded()
    • isComparable

      public boolean isComparable()
      Description copied from interface: Type
      True if the type supports equalTo and hash.
      Specified by:
      isComparable in interface Type
      Overrides:
      isComparable in class AbstractType
    • isOrderable

      public boolean isOrderable()
      Description copied from interface: Type
      True if the type supports compareTo.
      Specified by:
      isOrderable in interface Type
      Overrides:
      isOrderable in class AbstractType
    • getTypeOperatorDeclaration

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

      public Object getObjectValue(ConnectorSession session, Block block, int position)
      Description copied from interface: Type
      Gets an object representation of the type value in the block position. This is the value returned to the user via the REST endpoint and therefore must be JSON serializable.
    • createBlockBuilder

      public BlockBuilder 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
      Overrides:
      createBlockBuilder in class AbstractVariableWidthType
    • getRange

      public Optional<Type.Range> getRange()
      Description copied from interface: Type
      Return the range of possible values for this type, if available.

      The type of the values must match Type.getJavaType()

    • appendTo

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

      public io.airlift.slice.Slice getSlice(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a Slice.
      Specified by:
      getSlice in interface Type
      Overrides:
      getSlice in class AbstractType
    • writeString

      public void writeString(BlockBuilder blockBuilder, String value)
    • writeSlice

      public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value)
      Description copied from interface: Type
      Writes the Slice value into the BlockBuilder.
      Specified by:
      writeSlice in interface Type
      Overrides:
      writeSlice in class AbstractType
    • writeSlice

      public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length)
      Description copied from interface: Type
      Writes the Slice value into the BlockBuilder.
      Specified by:
      writeSlice in interface Type
      Overrides:
      writeSlice in class AbstractType
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractType
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractType