java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.WindowNode
- Record Components:
function- the window computation; never nullpartitionKeys- thePERcolumns; empty = single global partitionsortSpecs- the within-partition ordering; at least one requiredframe- the row scope fed tofunction; never nulloutputColumn- the name of the appended result column; never blankinput- the source relation; never nulllocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
public record WindowNode(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input, SourceLocation location)
extends Record
implements RelNode
Window operator — a non-collapsing per-partition computation that
adds one column to every input row without removing or merging any. It is the
algebraic, composable form of SQL's
OVER (PARTITION BY … ORDER BY … ROWS …) clause.
A single WindowNode covers all window families via the sealed
WindowFunction hierarchy; the WindowFrame sets the scope of rows
fed to the function. The surface syntax has two keyword forms:
ROLLING— sliding / cumulative aggregates (WindowFunction.AggregateWindow), e.g.ROLLING AVG(price) OVER 3 ROWS SORT trade_time ASC PER ticker AS avg3 (Ticks);WINDOW— ranking and offset functions (slices 3–4).
The output schema is the input schema with outputColumn() appended.
partitionKeys() may be empty (one partition over the whole relation —
the PER-less form); at least one sort key is
required. The operator buffers per partition (BAG materialisation) and
never pushes down in this slice.
-
Constructor Summary
ConstructorsConstructorDescriptionWindowNode(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input) Convenience constructor for tests:SourceLocation.UNKNOWN.WindowNode(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input, SourceLocation location) Creates an instance of aWindowNoderecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) final booleanIndicates whether some other object is "equal to" this one.frame()Returns the value of theframerecord component.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.location()Returns the value of thelocationrecord component.Returns the value of theoutputColumnrecord component.Returns the value of thepartitionKeysrecord component.Returns the value of thesortSpecsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.darkcollective.relix.ast.RelNode
children, mapChildren, materializationMode, prettyPrint
-
Constructor Details
-
WindowNode
public WindowNode(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input, SourceLocation location) Creates an instance of aWindowNoderecord class.- Parameters:
function- the value for thefunctionrecord componentpartitionKeys- the value for thepartitionKeysrecord componentsortSpecs- the value for thesortSpecsrecord componentframe- the value for theframerecord componentoutputColumn- the value for theoutputColumnrecord componentinput- the value for theinputrecord componentlocation- the value for thelocationrecord component
-
WindowNode
public WindowNode(WindowFunction function, List<String> partitionKeys, List<SortSpecification> sortSpecs, WindowFrame frame, String outputColumn, RelNode input) Convenience constructor for tests:SourceLocation.UNKNOWN.
-
-
Method Details
-
accept
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-
partitionKeys
Returns the value of thepartitionKeysrecord component.- Returns:
- the value of the
partitionKeysrecord component
-
sortSpecs
Returns the value of thesortSpecsrecord component.- Returns:
- the value of the
sortSpecsrecord component
-
frame
Returns the value of theframerecord component.- Returns:
- the value of the
framerecord component
-
outputColumn
Returns the value of theoutputColumnrecord component.- Returns:
- the value of the
outputColumnrecord component
-
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
location
Returns the value of thelocationrecord component.
-