@ThreadSafe public class DistinctType extends AbstractType
| Constructor and Description |
|---|
DistinctType(DistinctTypeInfo distinctTypeInfo,
Type baseType,
Function<QualifiedObjectName,DistinctType> distinctTypeLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(Block block,
int position,
BlockBuilder blockBuilder)
Append the value at
position in block to blockBuilder. |
int |
compareTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Compare the values in the specified block at the specified positions equal.
|
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.
|
boolean |
equals(Object obj) |
boolean |
equalTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Are the values in the specified blocks at the specified positions equal?
|
Type |
getBaseType() |
Block |
getBlockUnchecked(Block block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a block
without boundary checks. |
boolean |
getBoolean(Block block,
int position)
Gets the value at the
block position as a boolean. |
boolean |
getBooleanUnchecked(UncheckedBlock block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a boolean
without boundary checks. |
String |
getDisplayName()
Returns the name of this type that should be displayed to end-users.
|
double |
getDouble(Block block,
int position)
Gets the value at the
block position as a double. |
double |
getDoubleUnchecked(UncheckedBlock block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a double
without boundary checks. |
long |
getLong(Block block,
int position)
Gets the value at the
block position as a long. |
long |
getLongUnchecked(UncheckedBlock block,
int internalPosition)
Gets the value at the
block internalPosition - offsetBase as a long
without boundary checks. |
static Optional<DistinctType> |
getLowestCommonSuperType(DistinctType firstType,
DistinctType secondType) |
QualifiedObjectName |
getName() |
Object |
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. |
Optional<DistinctType> |
getParentTypeLoadIfNeeded() |
Optional<QualifiedObjectName> |
getParentTypeName() |
io.airlift.slice.Slice |
getSlice(Block block,
int position)
Gets the value at the
block position as a Slice. |
io.airlift.slice.Slice |
getSliceUnchecked(Block block,
int internalPosition)
Gets the value at the
block position as a Slice
without boundary checks |
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.
|
static boolean |
hasAncestorRelationship(DistinctType firstType,
DistinctType secondType) |
long |
hash(Block block,
int position)
Calculates the hash code of the value at the specified position in the
specified block.
|
int |
hashCode() |
boolean |
isComparable()
True if the type supports equalTo and hash.
|
boolean |
isOrderable()
True if the type supports compareTo.
|
void |
writeBoolean(BlockBuilder blockBuilder,
boolean value)
Writes the boolean value into the
BlockBuilder. |
void |
writeDouble(BlockBuilder blockBuilder,
double value)
Writes the double value into the
BlockBuilder. |
void |
writeLong(BlockBuilder blockBuilder,
long value)
Writes the long value into the
BlockBuilder. |
void |
writeObject(BlockBuilder blockBuilder,
Object value)
Writes the Object value into the
BlockBuilder. |
void |
writeSlice(BlockBuilder blockBuilder,
io.airlift.slice.Slice value)
Writes the Slice value into the
BlockBuilder. |
void |
writeSlice(BlockBuilder blockBuilder,
io.airlift.slice.Slice value,
int offset,
int length)
Writes the Slice value into the
BlockBuilder. |
getJavaType, toStringpublic DistinctType(DistinctTypeInfo distinctTypeInfo, Type baseType, Function<QualifiedObjectName,DistinctType> distinctTypeLoader)
public QualifiedObjectName getName()
public Type getBaseType()
public Optional<DistinctType> getParentTypeLoadIfNeeded()
public Optional<QualifiedObjectName> getParentTypeName()
public static boolean hasAncestorRelationship(DistinctType firstType, DistinctType secondType)
public static Optional<DistinctType> getLowestCommonSuperType(DistinctType firstType, DistinctType secondType)
public boolean equals(Object obj)
equals in class AbstractTypepublic int hashCode()
hashCode in class AbstractTypepublic TypeSignature getTypeSignature()
Typepublic String getDisplayName()
TypegetDisplayName in interface TypegetDisplayName in class AbstractTypepublic boolean isComparable()
TypeisComparable in interface TypeisComparable in class AbstractTypepublic boolean isOrderable()
TypeisOrderable in interface TypeisOrderable in class AbstractTypepublic List<Type> getTypeParameters()
TypegetTypeParameters in interface TypegetTypeParameters in class AbstractTypepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
Typepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
Typepublic 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 boolean getBoolean(Block block, int position)
Typeblock position as a boolean.getBoolean in interface TypegetBoolean in class AbstractTypepublic boolean getBooleanUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a boolean
without boundary checks.getBooleanUnchecked in interface TypegetBooleanUnchecked in class AbstractTypepublic long getLong(Block block, int position)
Typeblock position as a long.getLong in interface TypegetLong in class AbstractTypepublic long getLongUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a long
without boundary checks.getLongUnchecked in interface TypegetLongUnchecked in class AbstractTypepublic double getDouble(Block block, int position)
Typeblock position as a double.getDouble in interface TypegetDouble in class AbstractTypepublic double getDoubleUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a double
without boundary checks.getDoubleUnchecked in interface TypegetDoubleUnchecked in class AbstractTypepublic io.airlift.slice.Slice getSlice(Block block, int position)
Typeblock position as a Slice.getSlice in interface TypegetSlice in class AbstractTypepublic io.airlift.slice.Slice getSliceUnchecked(Block block, int internalPosition)
Typeblock position as a Slice
without boundary checksgetSliceUnchecked in interface TypegetSliceUnchecked in class AbstractTypepublic Object 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 writeBoolean(BlockBuilder blockBuilder, boolean value)
TypeBlockBuilder.writeBoolean in interface TypewriteBoolean in class AbstractTypepublic void writeLong(BlockBuilder blockBuilder, long value)
TypeBlockBuilder.writeLong in interface TypewriteLong in class AbstractTypepublic void writeDouble(BlockBuilder blockBuilder, double value)
TypeBlockBuilder.writeDouble in interface TypewriteDouble in class AbstractTypepublic void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value)
TypeBlockBuilder.writeSlice in interface TypewriteSlice in class AbstractTypepublic void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length)
TypeBlockBuilder.writeSlice in interface TypewriteSlice in class AbstractTypepublic void writeObject(BlockBuilder blockBuilder, Object value)
TypeBlockBuilder.writeObject in interface TypewriteObject in class AbstractTypepublic void appendTo(Block block, int position, BlockBuilder blockBuilder)
Typeposition in block to blockBuilder.public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypeThis method assumes input is not null.
equalTo in interface TypeequalTo in class AbstractTypepublic long hash(Block block, int position)
Typehash in interface Typehash in class AbstractTypepublic int compareTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypecompareTo in interface TypecompareTo in class AbstractTypeCopyright © 2012–2022. All rights reserved.