public abstract class NoFrameSupportTemplate extends Object implements WindowFramer
According to the SQL standard, LEAD, LAG, ROW_NUMBER, NTILE and all ranking functions don't support the FRAME clause. This class will handle such functions.
FRAME_TEMPLATE_DEFINITION, NOFRAME_TEMPLATE_DEFINITION
Constructor and Description |
---|
NoFrameSupportTemplate() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
abstract void |
copyFromInternal(int inIndex,
int outIndex) |
abstract void |
copyNext(int inIndex,
int outIndex)
Copies value(s) from inIndex row to outIndex row.
|
abstract void |
copyPrev(int inIndex,
int outIndex)
Copies value(s) from inIndex row to outIndex row.
|
void |
doWork()
Processes all rows of the first batch.
|
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,
Partition partition)
Called once for each row after we evaluate all peer rows.
|
abstract boolean |
resetValues()
Reset all window functions
|
void |
setup(List<WindowDataBatch> batches,
VectorContainer container,
OperatorContext oContext,
boolean requireFullPartition,
WindowPOP popConfig) |
abstract void |
setupCopyFromInternal(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupCopyNext(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupCopyPrev(VectorAccessible incoming,
VectorAccessible outgoing) |
abstract void |
setupPartition(WindowDataBatch incoming,
VectorAccessible outgoing)
Called once per partition, before processing the partition.
|
String |
toString() |
public void setup(List<WindowDataBatch> batches, VectorContainer container, OperatorContext oContext, boolean requireFullPartition, WindowPOP popConfig) throws SchemaChangeException
setup
in interface WindowFramer
SchemaChangeException
public void doWork()
doWork
in interface WindowFramer
public int getOutputCount()
getOutputCount
in interface WindowFramer
public void cleanup()
cleanup
in interface WindowFramer
public abstract void outputRow(@Named(value="outIndex") int outIndex, @Named(value="partition") Partition partition) throws SchemaChangeException
outIndex
- index of rowpartition
- object used by "computed" window functionsSchemaChangeException
public 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 void copyNext(@Named(value="inIndex") int inIndex, @Named(value="outIndex") int outIndex) throws SchemaChangeException
inIndex
- source row of the copyoutIndex
- destination row of the copy.SchemaChangeException
public abstract void setupCopyNext(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract void copyPrev(@Named(value="inIndex") int inIndex, @Named(value="outIndex") int outIndex) throws SchemaChangeException
inIndex
- source row of the copyoutIndex
- destination row of the copy.SchemaChangeException
public abstract void setupCopyPrev(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract void copyFromInternal(@Named(value="inIndex") int inIndex, @Named(value="outIndex") int outIndex) throws SchemaChangeException
SchemaChangeException
public abstract void setupCopyFromInternal(@Named(value="incoming") VectorAccessible incoming, @Named(value="outgoing") VectorAccessible outgoing) throws SchemaChangeException
SchemaChangeException
public abstract boolean resetValues() throws SchemaChangeException
SchemaChangeException
public abstract boolean isSamePartition(@Named(value="b1Index") int b1Index, @Named(value="b1") VectorAccessible b1, @Named(value="b2Index") int b2Index, @Named(value="b2") VectorAccessible b2) throws SchemaChangeException
isSamePartition
in interface WindowFramer
b1Index
- index of first rowb1
- batch for first rowb2Index
- index of second rowb2
- batch for second rowSchemaChangeException
public abstract boolean isPeer(@Named(value="b1Index") int b1Index, @Named(value="b1") VectorAccessible b1, @Named(value="b2Index") int b2Index, @Named(value="b2") VectorAccessible b2) throws SchemaChangeException
isPeer
in interface WindowFramer
b1Index
- index of first rowb1
- batch for first rowb2Index
- index of second rowb2
- batch for second rowSchemaChangeException
Copyright © 1970 The Apache Software Foundation. All rights reserved.