Package io.deephaven.api.agg.spec
Class AggSpecUnique
java.lang.Object
io.deephaven.api.agg.spec.AggSpecBase
io.deephaven.api.agg.spec.AggSpecUnique
- All Implemented Interfaces:
AggSpec
Specifies an aggregation that outputs the single unique input value for groups that have one,
null if all
input values are null, or nonUniqueSentinel() if there is more than one distinct value.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.api.agg.spec.AggSpec
AggSpec.Visitor -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGet a simple description for this AggSpec.booleanWhether to includenullvalues as a distinct value for determining if there is only one unique value to output.abstract Optional<UnionObject>The output value to use for groups that don't have a single unique input value.static AggSpecUniqueof()Specify a "unique" aggregation that does not treatnullas a value for purposes of determining if the values in a group are unique.static AggSpecUniqueof(boolean includeNulls, UnionObject nonUniqueSentinel) Specify a "unique" aggregation that optionally treatsnullas a value for purposes of determining if the values in a group are unique.static AggSpecUniqueEquivalent toof(includeNulls, UnionObject.from(nonUniqueSentinel)).final <V extends AggSpec.Visitor>
Vwalk(V visitor) Glue method to deliver this AggSpec to aAggSpec.Visitor.Methods inherited from class io.deephaven.api.agg.spec.AggSpecBase
aggregation, aggregation, aggregation
-
Field Details
-
INCLUDE_NULLS_DEFAULT
public static final boolean INCLUDE_NULLS_DEFAULT- See Also:
-
-
Constructor Details
-
AggSpecUnique
public AggSpecUnique()
-
-
Method Details
-
of
Specify a "unique" aggregation that does not treatnullas a value for purposes of determining if the values in a group are unique. If a group is non-empty but contains onlynullvalues, its result will benull. If a group contains more than a single unique value, its result will also benull.- Returns:
- The "unique" aggregation specification
-
of
Equivalent toof(includeNulls, UnionObject.from(nonUniqueSentinel)).- Parameters:
includeNulls- Whethernullis treated as a value for determining if the values in a group are uniquenonUniqueSentinel- Sentinel value to use if a group contains more than a single unique value- Returns:
- The "unique" aggregation specification
- See Also:
-
of
Specify a "unique" aggregation that optionally treatsnullas a value for purposes of determining if the values in a group are unique. If a group is non-empty but contains onlynullvalues, its result will benull. If a group contains more than a single unique value, its result will benonUniqueSentinel.- Parameters:
includeNulls- Whethernullis treated as a value for determining if the values in a group are uniquenonUniqueSentinel- Sentinel value to use if a group contains more than a single unique value- Returns:
- The "unique" aggregation specification
-
description
Description copied from interface:AggSpecGet a simple description for this AggSpec.- Returns:
- The description
-
includeNulls
@Default public boolean includeNulls()Whether to includenullvalues as a distinct value for determining if there is only one unique value to output.- Returns:
- Whether to include nulls
-
nonUniqueSentinel
The output value to use for groups that don't have a single unique input value.- Returns:
- The non-unique sentinel value
-
walk
Description copied from interface:AggSpecGlue method to deliver this AggSpec to aAggSpec.Visitor.- Parameters:
visitor- The visitor- Returns:
- The visitor
-