Class AggregateNAryFunction<T extends AggregateCollector,D>

java.lang.Object
org.eclipse.rdf4j.query.parser.sparql.aggregate.AggregateNAryFunction<T,D>
Type Parameters:
T -
D -
All Implemented Interfaces:
AggregateProcessor<T,List<D>>

@Experimental public abstract class AggregateNAryFunction<T extends AggregateCollector,D> extends Object implements AggregateProcessor<T,List<D>>
N-ary aggregate function processor.
Author:
Nik Kozlov
  • Field Details

  • Constructor Details

  • Method Details

    • processAggregate

      public abstract void processAggregate(BindingSet bindingSet, Predicate<List<D>> distinctTuple, T agv) throws QueryEvaluationException
      Process an aggregate with tuple-level distinctness for n-ary functions.
      Specified by:
      processAggregate in interface AggregateProcessor<T extends AggregateCollector,D>
      Parameters:
      bindingSet - the current binding set
      distinctTuple - predicate to check if the tuple of argument values is distinct. The tuple may contain an arbitrary amount of arguments, therefore if necessary single argument distinctness can be checked inside the predicate. Mixing argument sizes of tuples is not recommended. Note: do not mutate (or reuse) a mutable List instance after passing it to distinctTuple.test(...) because the predicate may keep it in a hash-based set. If you construct tuples using a mutable list, pass an immutable snapshot (e.g. List.copyOf(tuple)).
      agv - the aggregate collector
      Throws:
      QueryEvaluationException - if evaluation fails
    • evaluate

      protected Value evaluate(Integer index, BindingSet s) throws QueryEvaluationException
      Throws:
      QueryEvaluationException