Interface WindowIndex
public interface WindowIndex
A window index contains the sorted values for a window partition.
Each window function argument is available as a separate channel.
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendTo(int channel, int position, BlockBuilder output) Outputs a value from the index.booleangetBoolean(int channel, int position) Gets a value as aboolean.doublegetDouble(int channel, int position) Gets a value as adouble.longgetLong(int channel, int position) Gets a value as along.getObject(int channel, int position) Gets an object value.getSingleValueBlock(int channel, int position) Gets a value stored as aBlock.io.airlift.slice.SlicegetSlice(int channel, int position) Gets a value as aSlice.booleanisNull(int channel, int position) Check if a value is null.intsize()Gets the number of rows in the partition
-
Method Details
-
size
int size()Gets the number of rows in the partition -
isNull
boolean isNull(int channel, int position) Check if a value is null.- Parameters:
channel- argument numberposition- row within the partition, starting at zero- Returns:
- if the value is null
-
getBoolean
boolean getBoolean(int channel, int position) Gets a value as aboolean.- Parameters:
channel- argument numberposition- row within the partition, starting at zero- Returns:
- value at the specified channel and position
-
getLong
long getLong(int channel, int position) Gets a value as along.- Parameters:
channel- argument numberposition- row within the partition, starting at zero- Returns:
- value at the specified channel and position
-
getDouble
double getDouble(int channel, int position) Gets a value as adouble.- Parameters:
channel- argument numberposition- row within the partition, starting at zero- Returns:
- value at the specified channel and position
-
getSlice
io.airlift.slice.Slice getSlice(int channel, int position) Gets a value as aSlice.- Parameters:
channel- argument numberposition- row within the partition, starting at zero
-
getSingleValueBlock
-
getObject
Gets an object value.- Parameters:
channel- argument numberposition- row within the partition, starting at zero
-
appendTo
Outputs a value from the index. This is useful for "value" window functions such aslagthat operate on arbitrary types without caring about the specific contents.- Parameters:
channel- argument numberposition- row within the partition, starting at zerooutput- theBlockBuilderto output to
-