Class DoubleType

java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.DoubleType
All Implemented Interfaces:
FixedWidthType, Type

public final class DoubleType extends AbstractType implements FixedWidthType
  • Field Details

  • Method Details

    • getFixedSize

      public int getFixedSize()
      Description copied from interface: FixedWidthType
      Gets the size of a value of this type in bytes. All values of a FixedWidthType are the same size.
      Specified by:
      getFixedSize in interface FixedWidthType
    • 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.
      Specified by:
      getTypeOperatorDeclaration in interface 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.
      Specified by:
      getObjectValue 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
    • getDouble

      public double getDouble(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as a double.
      Specified by:
      getDouble in interface Type
      Overrides:
      getDouble in class AbstractType
    • writeDouble

      public void writeDouble(BlockBuilder blockBuilder, double value)
      Description copied from interface: Type
      Writes the double value into the BlockBuilder.
      Specified by:
      writeDouble in interface Type
      Overrides:
      writeDouble in class AbstractType
    • createBlockBuilder

      public BlockBuilder 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 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
    • createFixedSizeBlockBuilder

      public BlockBuilder createFixedSizeBlockBuilder(int positionCount)
      Description copied from interface: FixedWidthType
      Creates a block builder for this type sized to hold the specified number of positions.
      Specified by:
      createFixedSizeBlockBuilder in interface FixedWidthType
    • 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
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class AbstractType
    • 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()

      Specified by:
      getRange in interface Type
    • xxHash64

      public static long xxHash64(double value)