A MinAnalyticAggregator is an AnalyticFunction that determines the minimum of the property values. This is a subclass of MinAggregator that implements additional logic necessary to efficiently determine the minimum when values are deleted from consideration.
Create and use a MinAnalyticAggregator, with one of the following methods:
AnalyticAggregator ana = new AnalyticAggregator.Builder() .setAnalyticFunction(new MinAnalyticAggregator("prop")) .setPartition(new PartitionClause(Arrays.asList("category1"))) .setOrderBy(new OrderByClause(Arrays.asList(new OrderByElement("value2", OrderByElement.SortDir.DESC)))) .setWindow(new WindowClause(WindowClause.Type.ROWS, 12, 0)) .build();
AnalyticAggregator agg = AnalyticAggregator.getAnalytic("MinAnalyticAggregator(prop) partitionBy(category1) orderBy(value2 DESC) rows(12, 0)");
The values returned by the property of the object must be Comparable. This includes, but is not limited to, all numeric values and Strings.
The value's "compareTo" method may be called to establish which object is the maximum.
MinAnalyticAggregator accepts user-given window clauses.