Package io.substrait.expression
Class ImmutableAggregateFunctionInvocation
java.lang.Object
io.substrait.expression.AggregateFunctionInvocation
io.substrait.expression.ImmutableAggregateFunctionInvocation
Immutable implementation of
AggregateFunctionInvocation.
Use the builder to create immutable instances:
ImmutableAggregateFunctionInvocation.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableAggregateFunctionInvocation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the aggregation phase (e.g., initial, intermediate, final).Returns the ordered list of function arguments.builder()Creates a builder forImmutableAggregateFunctionInvocation.copyOf(AggregateFunctionInvocation instance) Creates an immutable copy of aAggregateFunctionInvocationvalue.Returns the aggregate function variant declaration.booleanThis instance is equal to all instances ofImmutableAggregateFunctionInvocationthat have equal attribute values.inthashCode()Computes a hash code from attributes:declaration,arguments,options,aggregationPhase,sort,outputType,invocation.Returns the aggregation invocation semantics (e.g., aggregate, merge).options()Returns the options applied to this aggregate function.Returns the output type produced by this invocation.sort()Returns the sort fields applied to this invocation, if any.toString()Prints the immutable valueAggregateFunctionInvocationwith attribute values.Copy the current immutable object by setting a value for theaggregationPhaseattribute.withArguments(FunctionArg... elements) Copy the current immutable object with elements that replace the content ofarguments.withArguments(Iterable<? extends FunctionArg> elements) Copy the current immutable object with elements that replace the content ofarguments.Copy the current immutable object by setting a value for thedeclarationattribute.Copy the current immutable object by setting a value for theinvocationattribute.withOptions(FunctionOption... elements) Copy the current immutable object with elements that replace the content ofoptions.withOptions(Iterable<? extends FunctionOption> elements) Copy the current immutable object with elements that replace the content ofoptions.withOutputType(Type value) Copy the current immutable object by setting a value for theoutputTypeattribute.withSort(Expression.SortField... elements) Copy the current immutable object with elements that replace the content ofsort.withSort(Iterable<? extends Expression.SortField> elements) Copy the current immutable object with elements that replace the content ofsort.Methods inherited from class io.substrait.expression.AggregateFunctionInvocation
check, getType
-
Method Details
-
declaration
Returns the aggregate function variant declaration.- Specified by:
declarationin classAggregateFunctionInvocation- Returns:
- the function variant declaration
-
arguments
Returns the ordered list of function arguments.- Specified by:
argumentsin classAggregateFunctionInvocation- Returns:
- list of function arguments
-
options
Returns the options applied to this aggregate function.- Specified by:
optionsin classAggregateFunctionInvocation- Returns:
- list of function options
-
aggregationPhase
Returns the aggregation phase (e.g., initial, intermediate, final).- Specified by:
aggregationPhasein classAggregateFunctionInvocation- Returns:
- aggregation phase
-
sort
Returns the sort fields applied to this invocation, if any.- Specified by:
sortin classAggregateFunctionInvocation- Returns:
- list of sort fields
-
outputType
Returns the output type produced by this invocation.- Specified by:
outputTypein classAggregateFunctionInvocation- Returns:
- the output type
-
invocation
Returns the aggregation invocation semantics (e.g., aggregate, merge).- Specified by:
invocationin classAggregateFunctionInvocation- Returns:
- aggregation invocation
-
withDeclaration
public final ImmutableAggregateFunctionInvocation withDeclaration(SimpleExtension.AggregateFunctionVariant value) Copy the current immutable object by setting a value for thedeclarationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for declaration- Returns:
- A modified copy or the
thisobject
-
withArguments
Copy the current immutable object with elements that replace the content ofarguments.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withArguments
public final ImmutableAggregateFunctionInvocation withArguments(Iterable<? extends FunctionArg> elements) Copy the current immutable object with elements that replace the content ofarguments. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of arguments elements to set- Returns:
- A modified copy or
thisif not changed
-
withOptions
Copy the current immutable object with elements that replace the content ofoptions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withOptions
public final ImmutableAggregateFunctionInvocation withOptions(Iterable<? extends FunctionOption> elements) Copy the current immutable object with elements that replace the content ofoptions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of options elements to set- Returns:
- A modified copy or
thisif not changed
-
withAggregationPhase
public final ImmutableAggregateFunctionInvocation withAggregationPhase(Expression.AggregationPhase value) Copy the current immutable object by setting a value for theaggregationPhaseattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for aggregationPhase- Returns:
- A modified copy or the
thisobject
-
withSort
Copy the current immutable object with elements that replace the content ofsort.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSort
public final ImmutableAggregateFunctionInvocation withSort(Iterable<? extends Expression.SortField> elements) Copy the current immutable object with elements that replace the content ofsort. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of sort elements to set- Returns:
- A modified copy or
thisif not changed
-
withOutputType
Copy the current immutable object by setting a value for theoutputTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for outputType- Returns:
- A modified copy or the
thisobject
-
withInvocation
public final ImmutableAggregateFunctionInvocation withInvocation(Expression.AggregationInvocation value) Copy the current immutable object by setting a value for theinvocationattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for invocation- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableAggregateFunctionInvocationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:declaration,arguments,options,aggregationPhase,sort,outputType,invocation. -
toString
Prints the immutable valueAggregateFunctionInvocationwith attribute values. -
copyOf
Creates an immutable copy of aAggregateFunctionInvocationvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable AggregateFunctionInvocation instance
-
builder
Creates a builder forImmutableAggregateFunctionInvocation.ImmutableAggregateFunctionInvocation.builder() .declaration(io.substrait.extension.SimpleExtension.AggregateFunctionVariant) // requireddeclaration.addArguments|addAllArguments(io.substrait.expression.FunctionArg) //argumentselements .addOptions|addAllOptions(io.substrait.expression.FunctionOption) //optionselements .aggregationPhase(io.substrait.expression.Expression.AggregationPhase) // requiredaggregationPhase.addSort|addAllSort(io.substrait.expression.Expression.SortField) //sortelements .outputType(io.substrait.type.Type) // requiredoutputType.invocation(io.substrait.expression.Expression.AggregationInvocation) // requiredinvocation.build();- Returns:
- A new ImmutableAggregateFunctionInvocation builder
-