Class MapType

All Implemented Interfaces:
Type

public class MapType extends AbstractType
  • Constructor Details

  • Method Details

    • getTypeOperatorDeclaration

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

      public MapBlockBuilder 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.
    • createBlockBuilder

      public MapBlockBuilder 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.
    • getKeyType

      public Type getKeyType()
    • getValueType

      public Type getValueType()
    • 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
    • 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.
    • appendTo

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

      public SqlMap getObject(Block block, int position)
      Description copied from interface: Type
      Gets the value at the block position as an Object.
      Specified by:
      getObject in interface Type
      Overrides:
      getObject in class AbstractType
    • writeObject

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

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

      public boolean isFlatVariableWidth()
      Description copied from interface: Type
      Returns true if this type is variable width when written to a flat buffer.
    • 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.
    • 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.
      Returns:
      the length of the variable width data
    • getTypeParameters

      public List<Type> getTypeParameters()
      Description copied from interface: Type
      For parameterized types returns the list of parameters.
      Specified by:
      getTypeParameters in interface Type
      Overrides:
      getTypeParameters in class AbstractType
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: Type
      Returns the name of this type that should be displayed to end-users.
      Specified by:
      getDisplayName in interface Type
      Overrides:
      getDisplayName in class AbstractType
    • createBlockFromKeyValue

      public MapBlock createBlockFromKeyValue(Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock)
    • getKeyNativeHashCode

      public MethodHandle getKeyNativeHashCode()
      Internal use by this package and io.trino.spi.block only.
    • getKeyBlockHashCode

      public MethodHandle getKeyBlockHashCode()
      Internal use by this package and io.trino.spi.block only.
    • getKeyBlockNativeEqual

      public MethodHandle getKeyBlockNativeEqual()
      Internal use by this package and io.trino.spi.block only.
    • getKeyBlockEqual

      public MethodHandle getKeyBlockEqual()
      Internal use by this package and io.trino.spi.block only.
    • getKeyBlockNativeIdentical

      public MethodHandle getKeyBlockNativeIdentical()
      Internal use by this package and io.trino.spi.block only.
    • getKeyBlockIdentical

      public MethodHandle getKeyBlockIdentical()
      Internal use by this package and io.trino.spi.block only.