Package io.trino.spi.type
Class AbstractVariableWidthType
java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.AbstractVariableWidthType
- All Implemented Interfaces:
Type,VariableWidthType
- Direct Known Subclasses:
CharType,HyperLogLogType,P4HyperLogLogType,QuantileDigestType,VarbinaryType,VarcharType
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final TypeOperatorDeclarationprotected static final TypeOperatorDeclarationprotected static final TypeOperatorDeclarationprotected static final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractVariableWidthType(TypeSignature signature, Class<?> javaType) -
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.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.getTypeOperatorDeclaration(TypeOperators typeOperators) Gets the declared type specific operators for this type.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.Methods inherited from class io.trino.spi.type.AbstractType
equals, getBoolean, getDisplayName, getDouble, getJavaType, getLong, getObject, getSlice, getTypeParameters, getTypeSignature, getValueBlockType, hashCode, isComparable, isOrderable, toString, writeBoolean, writeDouble, writeLong, writeObject, 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, getBoolean, getDiscreteValues, getDisplayName, getDouble, getJavaType, getLong, getNextValue, getObject, getObjectValue, getPreviousValue, getRange, getSlice, getTypeId, getTypeParameters, getTypeSignature, getValueBlockType, isComparable, isOrderable, writeBoolean, writeDouble, writeLong, writeObject, writeSlice, writeSlice
-
Field Details
-
EXPECTED_BYTES_PER_ENTRY
protected static final int EXPECTED_BYTES_PER_ENTRY- See Also:
-
DEFAULT_READ_OPERATORS
-
DEFAULT_COMPARABLE_OPERATORS
-
DEFAULT_ORDERING_OPERATORS
-
-
Constructor Details
-
AbstractVariableWidthType
-
-
Method Details
-
createBlockBuilder
public VariableWidthBlockBuilder 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.- Specified by:
createBlockBuilderin interfaceType
-
createBlockBuilder
public VariableWidthBlockBuilder 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.- Specified by:
createBlockBuilderin interfaceType
-
appendTo
Description copied from interface:TypeAppend the value atpositioninblocktoblockBuilder. -
getTypeOperatorDeclaration
Description copied from interface:TypeGets the declared type specific operators for this type.- Specified by:
getTypeOperatorDeclarationin interfaceType
-
getFlatFixedSize
public int getFlatFixedSize()Description copied from interface:TypeReturns the fixed size of this type when written to a flat buffer.- Specified by:
getFlatFixedSizein interfaceType
-
isFlatVariableWidth
public boolean isFlatVariableWidth()Description copied from interface:TypeReturns true if this type is variable width when written to a flat buffer.- Specified by:
isFlatVariableWidthin interfaceType
-
getFlatVariableWidthSize
Description copied from interface:TypeReturns the variable width size of the value at the specified position when written to a flat buffer.- Specified by:
getFlatVariableWidthSizein interfaceType
-
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.- Specified by:
relocateFlatVariableWidthOffsetsin interfaceType- Returns:
- the length of the variable width data
-