Class SmallintType
java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.SmallintType
- All Implemented Interfaces:
FixedWidthType,Type
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Field Summary
Fields -
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.createFixedSizeBlockBuilder(int positionCount) Creates a block builder for this type sized to hold the specified number of positions.booleangetDiscreteValues(Type.Range range) Returns a stream of discrete values inside the specified range (if supported by this type).intGets the size of a value of this type in bytes.intReturns the fixed size of this type when written to a flat buffer.longGets the value at theblockpositionas a long.getNextValue(Object object) Returns the minimum value that compares greater thanvalue.getObjectValue(ConnectorSession session, Block block, int position) Gets an object representation of the type value in theblockposition.getPreviousValue(Object object) Returns the maximum value that compares less thanvalue.getRange()Return the range of possible values for this type, if available.shortgetTypeOperatorDeclaration(TypeOperators typeOperators) Gets the declared type specific operators for this type.inthashCode()booleanTrue if the type supports equalTo and hash.booleanTrue if the type supports compareTo.voidwriteLong(BlockBuilder blockBuilder, long value) Writes the long value into theBlockBuilder.voidwriteShort(BlockBuilder blockBuilder, short value) Methods inherited from class io.trino.spi.type.AbstractType
getBoolean, getDisplayName, getDouble, getJavaType, getObject, getSlice, getTypeParameters, getTypeSignature, getValueBlockType, toString, writeBoolean, writeDouble, writeObject, writeSlice, writeSliceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.trino.spi.type.FixedWidthType
createBlockBuilder, getFlatVariableWidthSize, isFlatVariableWidth, relocateFlatVariableWidthOffsetsMethods inherited from interface io.trino.spi.type.Type
createNullBlock, getBaseName, getBoolean, getDisplayName, getDouble, getJavaType, getObject, getSlice, getTypeId, getTypeParameters, getTypeSignature, getValueBlockType, writeBoolean, writeDouble, writeObject, writeSlice, writeSlice
-
Field Details
-
SMALLINT
-
-
Method Details
-
getFixedSize
public int getFixedSize()Description copied from interface:FixedWidthTypeGets the size of a value of this type in bytes. All values of a FixedWidthType are the same size.- Specified by:
getFixedSizein interfaceFixedWidthType
-
createBlockBuilder
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
Description copied from interface:FixedWidthTypeCreates a block builder for this type sized to hold the specified number of positions.- Specified by:
createFixedSizeBlockBuilderin interfaceFixedWidthType
-
isComparable
public boolean isComparable()Description copied from interface:TypeTrue if the type supports equalTo and hash.- Specified by:
isComparablein interfaceType- Overrides:
isComparablein classAbstractType
-
isOrderable
public boolean isOrderable()Description copied from interface:TypeTrue if the type supports compareTo.- Specified by:
isOrderablein interfaceType- Overrides:
isOrderablein classAbstractType
-
getTypeOperatorDeclaration
Description copied from interface:TypeGets the declared type specific operators for this type.- Specified by:
getTypeOperatorDeclarationin interfaceType
-
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.- Specified by:
getObjectValuein interfaceType
-
getRange
Description copied from interface:TypeReturn the range of possible values for this type, if available.The type of the values must match
Type.getJavaType() -
getPreviousValue
Description copied from interface:TypeReturns the maximum value that compares less thanvalue.The type of the value must match
Type.getJavaType().- Specified by:
getPreviousValuein interfaceType
-
getNextValue
Description copied from interface:TypeReturns the minimum value that compares greater thanvalue.The type of the value must match
Type.getJavaType().- Specified by:
getNextValuein interfaceType
-
getDiscreteValues
Description copied from interface:TypeReturns a stream of discrete values inside the specified range (if supported by this type).- Specified by:
getDiscreteValuesin interfaceType
-
appendTo
Description copied from interface:TypeAppend the value atpositioninblocktoblockBuilder. -
getLong
-
getShort
-
writeLong
Description copied from interface:TypeWrites the long value into theBlockBuilder.- Specified by:
writeLongin interfaceType- Overrides:
writeLongin classAbstractType
-
writeShort
-
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
-
equals
- Overrides:
equalsin classAbstractType
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractType
-