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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
Get a simple description for this AggSpec.boolean
Whether to includenull
values 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 AggSpecUnique
of()
Specify a "unique" aggregation that does not treatnull
as a value for purposes of determining if the values in a group are unique.static AggSpecUnique
of
(boolean includeNulls, UnionObject nonUniqueSentinel) Specify a "unique" aggregation that optionally treatsnull
as a value for purposes of determining if the values in a group are unique.static AggSpecUnique
Equivalent 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 treatnull
as a value for purposes of determining if the values in a group are unique. If a group is non-empty but contains onlynull
values, 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
- Whethernull
is 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 treatsnull
as a value for purposes of determining if the values in a group are unique. If a group is non-empty but contains onlynull
values, its result will benull
. If a group contains more than a single unique value, its result will benonUniqueSentinel
.- Parameters:
includeNulls
- Whethernull
is 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:AggSpec
Get a simple description for this AggSpec.- Returns:
- The description
-
includeNulls
@Default public boolean includeNulls()Whether to includenull
values 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:AggSpec
Glue method to deliver this AggSpec to aAggSpec.Visitor
.- Parameters:
visitor
- The visitor- Returns:
- The visitor
-