Package io.trino.spi.type
Class CharType
java.lang.Object
io.trino.spi.type.AbstractType
io.trino.spi.type.AbstractVariableWidthType
io.trino.spi.type.CharType
- All Implemented Interfaces:
Type,VariableWidthType
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Field Summary
FieldsFields inherited from class io.trino.spi.type.AbstractVariableWidthType
DEFAULT_COMPARABLE_OPERATORS, DEFAULT_ORDERING_OPERATORS, DEFAULT_READ_OPERATORS, EXPECTED_BYTES_PER_ENTRY -
Method Summary
Modifier and TypeMethodDescriptioncreateBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries) Creates the preferred block builder for this type.static CharTypecreateCharType(int length) static CharTypecreateCharType(long length) Deprecated.booleanintgetObjectValue(ConnectorSession session, Block block, int position) Gets an object representation of the type value in theblockposition.getRange()Return the range of possible values for this type, if available.io.airlift.slice.SliceGets the value at theblockpositionas a Slice.getTypeOperatorDeclaration(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.voidwriteSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value) Writes the Slice value into theBlockBuilder.voidwriteSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length) Writes the Slice value into theBlockBuilder.voidwriteString(BlockBuilder blockBuilder, String value) Methods inherited from class io.trino.spi.type.AbstractVariableWidthType
appendTo, createBlockBuilder, getFlatFixedSize, getFlatVariableWidthSize, isFlatVariableWidth, relocateFlatVariableWidthOffsetsMethods inherited from class io.trino.spi.type.AbstractType
getBoolean, getDisplayName, getDouble, getJavaType, getLong, getObject, getTypeParameters, getTypeSignature, getValueBlockType, toString, writeBoolean, writeDouble, writeLong, writeObjectMethods 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, getPreviousValue, getTypeId, getTypeParameters, getTypeSignature, getValueBlockType, writeBoolean, writeDouble, writeLong, writeObject
-
Field Details
-
MAX_LENGTH
public static final int MAX_LENGTH- See Also:
-
-
Method Details
-
createCharType
Deprecated.UsecreateCharType(int)instead. -
createCharType
-
getLength
public int getLength() -
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- Overrides:
getTypeOperatorDeclarationin classAbstractVariableWidthType
-
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() -
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. -
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- Overrides:
createBlockBuilderin classAbstractVariableWidthType
-
getSlice
Description copied from interface:TypeGets the value at theblockpositionas a Slice.- Specified by:
getSlicein interfaceType- Overrides:
getSlicein classAbstractType
-
writeString
-
writeSlice
Description copied from interface:TypeWrites the Slice value into theBlockBuilder.- Specified by:
writeSlicein interfaceType- Overrides:
writeSlicein classAbstractType
-
writeSlice
public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length) Description copied from interface:TypeWrites the Slice value into theBlockBuilder.- Specified by:
writeSlicein interfaceType- Overrides:
writeSlicein classAbstractType
-
equals
- Overrides:
equalsin classAbstractType
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractType
-
createCharType(int)instead.