@API(value=EXPERIMENTAL) public abstract class IndexAggregateGroupKeys extends Object
IndexAggregateFunction
given query conditions.
To implement an aggregate function XXX(value BY group)
using an index, the group needs to be fixed,
which will be true when the query has a filter
on group
(equivalent to SQL WHERE group = ?
).Modifier and Type | Class and Description |
---|---|
protected static class |
IndexAggregateGroupKeys.Conditions |
protected static class |
IndexAggregateGroupKeys.IndexScan |
Constructor and Description |
---|
IndexAggregateGroupKeys() |
Modifier and Type | Method and Description |
---|---|
static Optional<IndexAggregateGroupKeys> |
conditionsToGroupKeys(IndexAggregateFunction function,
QueryComponent conditions) |
static Optional<IndexAggregateGroupKeys> |
conditionsToGroupKeys(KeyExpression operand,
QueryComponent conditions) |
abstract int |
getColumnSize()
Get the size of the prefix of the index aggregate that is returned.
|
abstract Key.Evaluated |
getGroupKeys(FDBRecordStoreBase<?> store,
EvaluationContext context)
Get the grouping key (GROUP BY) for the index aggregate from the given context.
|
static IndexAggregateGroupKeys |
indexScanToGroupKeys(String recordKey,
int prefixSize) |
@Nonnull public abstract Key.Evaluated getGroupKeys(@Nullable FDBRecordStoreBase<?> store, @Nullable EvaluationContext context)
store
- the record store for the querycontext
- context in which to evaluate keyspublic abstract int getColumnSize()
public static Optional<IndexAggregateGroupKeys> conditionsToGroupKeys(@Nonnull IndexAggregateFunction function, @Nullable QueryComponent conditions)
public static Optional<IndexAggregateGroupKeys> conditionsToGroupKeys(@Nonnull KeyExpression operand, @Nullable QueryComponent conditions)
public static IndexAggregateGroupKeys indexScanToGroupKeys(@Nonnull String recordKey, int prefixSize)