| Constructor and Description |
|---|
FunctionType(List<Type> argumentTypes,
Type returnType) |
| 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?
|
List<Type> |
getArgumentTypes() |
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. |
Type |
getReturnType() |
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. |
public static final String NAME
public Type getReturnType()
public List<Type> getTypeParameters()
TypegetTypeParameters in interface Typepublic final TypeSignature getTypeSignature()
TypegetTypeSignature in interface Typepublic String getDisplayName()
TypegetDisplayName in interface Typepublic final Class<?> getJavaType()
TypeCurrently, this must be boolean, long, double, Slice or Block.
getJavaType in interface Typepublic boolean isComparable()
TypeisComparable in interface Typepublic boolean isOrderable()
TypeisOrderable in interface Typepublic long hash(Block block, int position)
Typepublic boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
TypeThis method assumes input is not null.
public int compareTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
Typepublic boolean getBoolean(Block block, int position)
Typeblock position as a boolean.getBoolean in interface Typepublic boolean getBooleanUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a boolean
without boundary checks.getBooleanUnchecked in interface Typepublic void writeBoolean(BlockBuilder blockBuilder, boolean value)
TypeBlockBuilder.writeBoolean in interface Typepublic long getLong(Block block, int position)
Typeblock position as a long.public long getLongUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a long
without boundary checks.getLongUnchecked in interface Typepublic void writeLong(BlockBuilder blockBuilder, long value)
TypeBlockBuilder.public double getDouble(Block block, int position)
Typeblock position as a double.public double getDoubleUnchecked(UncheckedBlock block, int internalPosition)
Typeblock internalPosition - offsetBase as a double
without boundary checks.getDoubleUnchecked in interface Typepublic void writeDouble(BlockBuilder blockBuilder, double value)
TypeBlockBuilder.writeDouble in interface Typepublic io.airlift.slice.Slice getSlice(Block block, int position)
Typeblock position as a Slice.public io.airlift.slice.Slice getSliceUnchecked(Block block, int internalPosition)
Typeblock position as a Slice
without boundary checksgetSliceUnchecked in interface Typepublic void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value)
TypeBlockBuilder.writeSlice in interface Typepublic void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length)
TypeBlockBuilder.writeSlice in interface Typepublic Object getObject(Block block, int position)
Typeblock position as an Object.public Block getBlockUnchecked(Block block, int internalPosition)
Typeblock internalPosition - offsetBase as a block
without boundary checks.getBlockUnchecked in interface Typepublic void writeObject(BlockBuilder blockBuilder, Object value)
TypeBlockBuilder.writeObject in interface 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.getObjectValue in interface Typepublic void appendTo(Block block, int position, BlockBuilder blockBuilder)
Typeposition in block to blockBuilder.public BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
TypecreateBlockBuilder in interface Typepublic BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)
TypecreateBlockBuilder in interface TypeCopyright © 2012–2022. All rights reserved.