Package io.trino.spi.type
Class MapType
java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.MapType
- All Implemented Interfaces:
Type
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendTo(Block block, int position, BlockBuilder blockBuilder) Append the value atpositioninblocktoblockBuilder.createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries) Creates the preferred block builder for this type.createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry) Creates the preferred block builder for this type.createBlockFromKeyValue(Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock) Returns the name of this type that should be displayed to end-users.intReturns the fixed size of this type when written to a flat buffer.intgetFlatVariableWidthSize(Block block, int position) Returns the variable width size of the value at the specified position when written to a flat buffer.Internal use by this package and io.trino.spi.block only.Internal use by this package and io.trino.spi.block only.Internal use by this package and io.trino.spi.block only.Internal use by this package and io.trino.spi.block only.Internal use by this package and io.trino.spi.block only.Internal use by this package and io.trino.spi.block only.Gets the value at theblockpositionas an Object.getObjectValue(ConnectorSession session, Block block, int position) Gets an object representation of the type value in theblockposition.getTypeOperatorDeclaration(TypeOperators typeOperators) Gets the declared type specific operators for this type.For parameterized types returns the list of parameters.booleanTrue if the type supports equalTo and hash.booleanReturns true if this type is variable width when written to a flat buffer.intrelocateFlatVariableWidthOffsets(byte[] fixedSizeSlice, int fixedSizeOffset, byte[] variableSizeSlice, int variableSizeOffset) Update the variable width offsets recorded in the value.voidwriteObject(BlockBuilder blockBuilder, Object value) Writes the Object value into theBlockBuilder.Methods inherited from class io.trino.spi.type.AbstractType
equals, getBoolean, getDouble, getJavaType, getLong, getSlice, getTypeSignature, getValueBlockType, hashCode, isOrderable, toString, writeBoolean, writeDouble, writeLong, writeSlice, writeSliceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.trino.spi.type.Type
getBaseName, getDiscreteValues, getNextValue, getPreviousValue, getRange, getTypeId
-
Constructor Details
-
MapType
-
-
Method Details
-
getTypeOperatorDeclaration
Description copied from interface:TypeGets the declared type specific operators for this type. -
createBlockBuilder
public MapBlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry) Description copied from interface:TypeCreates 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:TypeCreates the preferred block builder for this type. This is the builder used to store values after an expression projection within the query. -
getKeyType
-
getValueType
-
isComparable
public boolean isComparable()Description copied from interface:TypeTrue if the type supports equalTo and hash.- Specified by:
isComparablein interfaceType- Overrides:
isComparablein classAbstractType
-
getObjectValue
Description copied from interface:TypeGets an object representation of the type value in theblockposition. This is the value returned to the user via the REST endpoint and therefore must be JSON serializable. -
appendTo
Description copied from interface:TypeAppend the value atpositioninblocktoblockBuilder. -
getObject
Description copied from interface:TypeGets the value at theblockpositionas an Object.- Specified by:
getObjectin interfaceType- Overrides:
getObjectin classAbstractType
-
writeObject
Description copied from interface:TypeWrites the Object value into theBlockBuilder.- Specified by:
writeObjectin interfaceType- Overrides:
writeObjectin classAbstractType
-
getFlatFixedSize
public int getFlatFixedSize()Description copied from interface:TypeReturns the fixed size of this type when written to a flat buffer. -
isFlatVariableWidth
public boolean isFlatVariableWidth()Description copied from interface:TypeReturns true if this type is variable width when written to a flat buffer. -
getFlatVariableWidthSize
Description copied from interface:TypeReturns 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:TypeUpdate 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
Description copied from interface:TypeFor parameterized types returns the list of parameters.- Specified by:
getTypeParametersin interfaceType- Overrides:
getTypeParametersin classAbstractType
-
getDisplayName
Description copied from interface:TypeReturns the name of this type that should be displayed to end-users.- Specified by:
getDisplayNamein interfaceType- Overrides:
getDisplayNamein classAbstractType
-
createBlockFromKeyValue
-
getKeyNativeHashCode
Internal use by this package and io.trino.spi.block only. -
getKeyBlockHashCode
Internal use by this package and io.trino.spi.block only. -
getKeyBlockNativeEqual
Internal use by this package and io.trino.spi.block only. -
getKeyBlockEqual
Internal use by this package and io.trino.spi.block only. -
getKeyBlockNativeNotDistinctFrom
Internal use by this package and io.trino.spi.block only. -
getKeyBlockNotDistinctFrom
Internal use by this package and io.trino.spi.block only.
-