public abstract class FrameSupportTemplate extends Object implements WindowFramer
FRAME_TEMPLATE_DEFINITION, NOFRAME_TEMPLATE_DEFINITION
Constructor and Description |
---|
FrameSupportTemplate() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
void |
doWork()
processes all rows of the first batch.
|
abstract void |
evaluatePeer(int index)
called once for each peer row of the current frame.
|
int |
getOutputCount() |
abstract boolean |
isPeer(int b1Index,
VectorAccessible b1,
int b2Index,
VectorAccessible b2)
compares two rows from different batches (can be the same), if they have the same value for the order by
expression
|
abstract boolean |
isSamePartition(int b1Index,
VectorAccessible b1,
int b2Index,
VectorAccessible b2)
compares two rows from different batches (can be the same), if they have the same value for the partition by
expression
|
abstract void |
outputRow(int outIndex)
called once for each row after we evaluate all peer rows.
|
abstract boolean |
resetValues()
reset all window functions
|
abstract void |
saveFirstValue(int index) |
void |
setup(List<WindowDataBatch> batches,
VectorContainer container,
OperatorContext oContext,
boolean requireFullPartition,
WindowPOP popConfig) |
abstract void |
setupEvaluatePeer(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupPartition(WindowDataBatch incoming,
VectorAccessible outgoing)
Called once per partition, before processing the partition.
|
abstract void |
setupReadLastValue(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupSaveFirstValue(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupWriteFirstValue(VectorAccessible incoming,
VectorAccessible outgoing) |
String |
toString() |
abstract void |
writeLastValue(int index,
int outIndex) |
public void setup(List<WindowDataBatch> batches, VectorContainer container, OperatorContext oContext, boolean requireFullPartition, WindowPOP popConfig) throws SchemaChangeException
setup
in interface WindowFramer
SchemaChangeException
public void doWork() throws SchemaChangeException
doWork
in interface WindowFramer
SchemaChangeException
public int getOutputCount()
getOutputCount
in interface WindowFramer
public void cleanup()
cleanup
in interface WindowFramer
public abstract void evaluatePeer(@Named(value="index") int index)
index
- of row to aggregatepublic abstract void setupEvaluatePeer(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract void setupReadLastValue(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract void writeLastValue(@Named(value="index") int index, @Named(value="outIndex") int outIndex)
public abstract void setupSaveFirstValue(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract void saveFirstValue(@Named(value="index") int index)
public abstract void setupWriteFirstValue(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing)
public abstract void outputRow(@Named(value="outIndex") int outIndex)
outIndex
- index of rowpublic abstract void setupPartition(@Named(value="incoming") WindowDataBatch incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
incoming
- batch we will read fromoutgoing
- batch we will be writing toSchemaChangeException
public abstract boolean resetValues()
public abstract boolean isSamePartition(@Named(value="b1Index") int b1Index, @Named(value="b1") VectorAccessible b1, @Named(value="b2Index") int b2Index, @Named(value="b2") VectorAccessible b2)
isSamePartition
in interface WindowFramer
b1Index
- index of first rowb1
- batch for first rowb2Index
- index of second rowb2
- batch for second rowpublic abstract boolean isPeer(@Named(value="b1Index") int b1Index, @Named(value="b1") VectorAccessible b1, @Named(value="b2Index") int b2Index, @Named(value="b2") VectorAccessible b2)
isPeer
in interface WindowFramer
b1Index
- index of first rowb1
- batch for first rowb2Index
- index of second rowb2
- batch for second rowCopyright © 1970 The Apache Software Foundation. All rights reserved.