Interface FixedWidthType
- All Superinterfaces:
Type
- All Known Implementing Classes:
AbstractIntType,AbstractLongType,BigintType,BooleanType,DateType,DecimalType,DoubleType,IntegerType,RealType,SmallintType,TimestampType,TimestampWithTimeZoneType,TimeType,TimeWithTimeZoneType,TinyintType,UuidType
FixedWidthType is a type that has a fixed size for every value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Method Summary
Modifier and TypeMethodDescriptiondefault BlockBuildercreateBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry) Creates the preferred block builder for this type.createFixedSizeBlockBuilder(int positionCount) Creates a block builder for this type sized to hold the specified number of positions.intGets the size of a value of this type in bytes.default intgetFlatVariableWidthSize(Block block, int position) Returns the variable width size of the value at the specified position when written to a flat buffer.default booleanReturns true if this type is variable width when written to a flat buffer.default intrelocateFlatVariableWidthOffsets(byte[] fixedSizeSlice, int fixedSizeOffset, byte[] variableSizeSlice, int variableSizeOffset) Update the variable width offsets recorded in the value.Methods inherited from interface io.trino.spi.type.Type
appendTo, createBlockBuilder, createNullBlock, getBaseName, getBoolean, getDiscreteValues, getDisplayName, getDouble, getFlatFixedSize, getJavaType, getLong, getNextValue, getObject, getObjectValue, getPreviousValue, getRange, getSlice, getTypeId, getTypeOperatorDeclaration, getTypeParameters, getTypeSignature, getValueBlockType, isComparable, isOrderable, writeBoolean, writeDouble, writeLong, writeObject, writeSlice, writeSlice
-
Method Details
-
getFixedSize
int getFixedSize()Gets the size of a value of this type in bytes. All values of a FixedWidthType are the same size. -
createBlockBuilder
default BlockBuilder 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
-
createFixedSizeBlockBuilder
Creates a block builder for this type sized to hold the specified number of positions. -
isFlatVariableWidth
default 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
default 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
-