public class MapType extends AbstractType
| Constructor and Description |
|---|
MapType(Type keyType,
Type valueType,
MethodHandle keyBlockEquals,
MethodHandle keyBlockHashCode) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(Block block,
int position,
BlockBuilder blockBuilder)
Append the value at
position in block to blockBuilder. |
BlockBuilder |
createBlockBuilder(BlockBuilderStatus blockBuilderStatus,
int expectedEntries)
Creates the preferred block builder for this type.
|
BlockBuilder |
createBlockBuilder(BlockBuilderStatus blockBuilderStatus,
int expectedEntries,
int expectedBytesPerEntry)
Creates the preferred block builder for this type.
|
Block |
createBlockFromKeyValue(int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock) |
static Block |
createMapBlockInternal(int startOffset,
int positionCount,
Optional<boolean[]> mapIsNull,
int[] offsets,
Block keyBlock,
Block valueBlock,
AbstractMapBlock.HashTables hashTables)
Create a map block directly without per element validations.
|
boolean |
equalTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Are the values in the specified blocks at the specified positions equal?
|
Block |
getBlockUnchecked(Block block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a block
without boundary checks. |
String |
getDisplayName()
Returns the name of this type that should be displayed to end-users.
|
MethodHandle |
getKeyBlockEquals() |
MethodHandle |
getKeyBlockHashCode() |
Type |
getKeyType() |
Block |
getObject(Block block,
int position)
Gets the value at the
block position as an Object. |
Object |
getObjectValue(SqlFunctionProperties properties,
Block block,
int position)
Gets an object representation of the type value in the
block
position. |
List<Type> |
getTypeParameters()
For parameterized types returns the list of parameters.
|
TypeSignature |
getTypeSignature()
Gets the name of this type which must be case insensitive globally unique.
|
Type |
getValueType() |
long |
hash(Block block,
int position)
Calculates the hash code of the value at the specified position in the
specified block.
|
boolean |
isComparable()
True if the type supports equalTo and hash.
|
void |
writeObject(BlockBuilder blockBuilder,
Object value)
Writes the Object value into the
BlockBuilder. |
compareTo, equals, getBoolean, getBooleanUnchecked, getDouble, getDoubleUnchecked, getJavaType, getLong, getLongUnchecked, getSlice, getSliceUnchecked, hashCode, isOrderable, toString, writeBoolean, writeDouble, writeLong, writeSlice, writeSlicepublic MapType(Type keyType, Type valueType, MethodHandle keyBlockEquals, MethodHandle keyBlockHashCode)
public TypeSignature getTypeSignature()
Typepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
Typepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
Typepublic Type getKeyType()
public Type getValueType()
public boolean isComparable()
TypeisComparable in interface TypeisComparable in class AbstractTypepublic MethodHandle getKeyBlockEquals()
public MethodHandle getKeyBlockHashCode()
public long hash(Block block, int position)
Typehash in interface Typehash in class AbstractTypepublic boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypeThis method assumes input is not null.
equalTo in interface TypeequalTo in class AbstractTypepublic Object getObjectValue(SqlFunctionProperties properties, Block block, int position)
Typeblock
position. This is the value returned to the user via the
REST endpoint and therefore must be JSON serializable.public void appendTo(Block block, int position, BlockBuilder blockBuilder)
Typeposition in block to blockBuilder.public Block getObject(Block block, int position)
Typeblock position as an Object.getObject in interface TypegetObject in class AbstractTypepublic Block getBlockUnchecked(Block block, int internalPosition)
Typeblock internalPosition - offsetBase as a block
without boundary checks.getBlockUnchecked in interface TypegetBlockUnchecked in class AbstractTypepublic void writeObject(BlockBuilder blockBuilder, Object value)
TypeBlockBuilder.writeObject in interface TypewriteObject in class AbstractTypepublic List<Type> getTypeParameters()
TypegetTypeParameters in interface TypegetTypeParameters in class AbstractTypepublic String getDisplayName()
TypegetDisplayName in interface TypegetDisplayName in class AbstractTypepublic Block createBlockFromKeyValue(int positionCount, Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock)
public static Block createMapBlockInternal(int startOffset, int positionCount, Optional<boolean[]> mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, AbstractMapBlock.HashTables hashTables)
Internal use by com.facebook.presto.spi.Block only.
Copyright © 2012–2022. All rights reserved.