Module com.darkcollective.relix.ast
Package com.darkcollective.relix.ast
Record Class AggregationNode
java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.AggregationNode
- Record Components:
groupingKeys- the keys to group byaggregates- the aggregate functions to applyinput- the source relationlocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
public record AggregationNode(List<GroupingKey> groupingKeys, List<AggregateFunction> aggregates, RelNode input, SourceLocation location)
extends Record
implements RelNode
Represents an aggregation operation (γ) in relational algebra.
Groups tuples by the
grouping keys and applies aggregate
functions.
A grouping key is a full Operand expression, not merely a column
reference, so a group may be formed over a derived value — e.g.
γ YEAR(occurred_at) → yr, COUNT(id) (Events) — with the common case
γ customer_id, SUM(amount) (Orders) simply grouping over a bare column.
-
Constructor Summary
ConstructorsConstructorDescriptionAggregationNode(List<GroupingKey> groupingKeys, List<AggregateFunction> aggregates, RelNode input, SourceLocation location) Creates an instance of aAggregationNoderecord class.AggregationNode(List<String> groupingColumns, List<AggregateFunction> aggregates, RelNode input) Convenience constructor grouping by bare column names — the classic form, used throughout call sites and tests that group by plain columns. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) Returns the value of theaggregatesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegroupingKeysrecord 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.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
-
AggregationNode
public AggregationNode(List<GroupingKey> groupingKeys, List<AggregateFunction> aggregates, RelNode input, SourceLocation location) Creates an instance of aAggregationNoderecord class.- Parameters:
groupingKeys- the value for thegroupingKeysrecord componentaggregates- the value for theaggregatesrecord componentinput- the value for theinputrecord componentlocation- the value for thelocationrecord component
-
AggregationNode
public AggregationNode(List<String> groupingColumns, List<AggregateFunction> aggregates, RelNode input) Convenience constructor grouping by bare column names — the classic form, used throughout call sites and tests that group by plain columns. UsesSourceLocation.UNKNOWN. Anullcolumn list is preserved as a null grouping (ungrouped aggregation).
-
-
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). -
groupingKeys
Returns the value of thegroupingKeysrecord component.- Returns:
- the value of the
groupingKeysrecord component
-
aggregates
Returns the value of theaggregatesrecord component.- Returns:
- the value of the
aggregatesrecord component
-
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
location
Returns the value of thelocationrecord component.
-