|
|
|
@ -464,7 +464,7 @@ public class AccountingPersistenceQueryCouchBase implements
|
|
|
|
|
public SortedSet<NumberedFilter> getNextPossibleValues(
|
|
|
|
|
Class<? extends AggregatedRecord<?, ?>> clz,
|
|
|
|
|
TemporalConstraint temporalConstraint, List<Filter> filters,
|
|
|
|
|
String topKey, String orderingProperty) throws Exception {
|
|
|
|
|
String key, String orderingProperty) throws Exception {
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SELECT
|
|
|
|
@ -518,7 +518,7 @@ public class AccountingPersistenceQueryCouchBase implements
|
|
|
|
|
selectExpressions.add(x("SUM(" + getQualifiedProperty(orderingProperty) + ")").
|
|
|
|
|
as(orderingProperty));
|
|
|
|
|
|
|
|
|
|
selectExpressions.add(x(getQualifiedProperty(topKey)).as(topKey));
|
|
|
|
|
selectExpressions.add(x(getQualifiedProperty(key)).as(key));
|
|
|
|
|
|
|
|
|
|
Expression whereExpression =
|
|
|
|
|
x(getQualifiedProperty(BasicUsageRecord.SCOPE)).
|
|
|
|
@ -588,7 +588,7 @@ public class AccountingPersistenceQueryCouchBase implements
|
|
|
|
|
Sort sort = Sort.desc(orderingProperty);
|
|
|
|
|
|
|
|
|
|
LimitPath path = select(selectExpressionArray).from(bucketName)
|
|
|
|
|
.where(whereExpression).groupBy(topKey).orderBy(sort);
|
|
|
|
|
.where(whereExpression).groupBy(key).orderBy(sort);
|
|
|
|
|
|
|
|
|
|
logger.debug(path.toString());
|
|
|
|
|
|
|
|
|
@ -619,12 +619,12 @@ public class AccountingPersistenceQueryCouchBase implements
|
|
|
|
|
JsonObject jsonObject = row.value();
|
|
|
|
|
logger.trace("JsonObject : {}", row.toString());
|
|
|
|
|
|
|
|
|
|
String value = jsonObject.getString(topKey);
|
|
|
|
|
String value = jsonObject.getString(key);
|
|
|
|
|
|
|
|
|
|
Number n = jsonObject.getDouble(orderingProperty);
|
|
|
|
|
|
|
|
|
|
NumberedFilter numberedFilter =
|
|
|
|
|
new NumberedFilter(topKey, value, n, orderingProperty);
|
|
|
|
|
new NumberedFilter(key, value, n, orderingProperty);
|
|
|
|
|
|
|
|
|
|
ret.add(numberedFilter);
|
|
|
|
|
|
|
|
|
|