public interface Type
| 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 |
equalTo(Block leftBlock,
int leftPosition,
Block rightBlock,
int rightPosition)
Are the values in the specified blocks at the specified positions equal?
|
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. |
Class<?> |
getJavaType()
Gets the Java class type used to represent this value on the stack during
expression execution.
|
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. |
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. |
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.
|
long |
hash(Block block,
int position)
Calculates the hash code of the value at the specified position in the
specified block.
|
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. |
TypeSignature getTypeSignature()
String getDisplayName()
boolean isComparable()
boolean isOrderable()
Class<?> getJavaType()
Currently, this must be boolean, long, double, Slice or Block.
List<Type> getTypeParameters()
BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
Object getObjectValue(SqlFunctionProperties properties, Block block, int position)
block
position. This is the value returned to the user via the
REST endpoint and therefore must be JSON serializable.boolean getBoolean(Block block, int position)
block position as a boolean.boolean getBooleanUnchecked(UncheckedBlock block, int internalPosition)
block internalPosition - offsetBase as a boolean
without boundary checks.long getLong(Block block, int position)
block position as a long.long getLongUnchecked(UncheckedBlock block, int internalPosition)
block internalPosition - offsetBase as a long
without boundary checks.double getDouble(Block block, int position)
block position as a double.double getDoubleUnchecked(UncheckedBlock block, int internalPosition)
block internalPosition - offsetBase as a double
without boundary checks.io.airlift.slice.Slice getSlice(Block block, int position)
block position as a Slice.io.airlift.slice.Slice getSliceUnchecked(Block block, int internalPosition)
block position as a Slice
without boundary checksObject getObject(Block block, int position)
block position as an Object.Block getBlockUnchecked(Block block, int internalPosition)
block internalPosition - offsetBase as a block
without boundary checks.void writeBoolean(BlockBuilder blockBuilder, boolean value)
BlockBuilder.void writeLong(BlockBuilder blockBuilder, long value)
BlockBuilder.void writeDouble(BlockBuilder blockBuilder, double value)
BlockBuilder.void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value)
BlockBuilder.void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length)
BlockBuilder.void writeObject(BlockBuilder blockBuilder, Object value)
BlockBuilder.void appendTo(Block block, int position, BlockBuilder blockBuilder)
position in block to blockBuilder.boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
This method assumes input is not null.
long hash(Block block, int position)
Copyright © 2012–2022. All rights reserved.