Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query context flag doAggregateTopNMetricFirst #171

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/in/zapr/druid/druidry/query/config/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class Context {

// topN query contexts
private Integer minTopNThreshold;
private Boolean doAggregateTopNMetricFirst;

// timeseries query contexts
private Boolean skipEmptyBuckets;
Expand Down Expand Up @@ -90,6 +91,7 @@ private Context(Long timeoutInMilliSeconds,
Boolean serializeDateTimeAsLong,
Boolean serializeDateTimeAsLongInner,
Integer minTopNThreshold,
Boolean doAggregateTopNMetricFirst,
Boolean skipEmptyBuckets,
Long maxMergingDictionarySize,
Long maxOnDiskStorage,
Expand Down Expand Up @@ -124,6 +126,7 @@ private Context(Long timeoutInMilliSeconds,
this.serializeDateTimeAsLong = serializeDateTimeAsLong;
this.serializeDateTimeAsLongInner = serializeDateTimeAsLongInner;
this.minTopNThreshold = minTopNThreshold;
this.doAggregateTopNMetricFirst = doAggregateTopNMetricFirst;
this.skipEmptyBuckets = skipEmptyBuckets;
this.maxMergingDictionarySize = maxMergingDictionarySize;
this.maxOnDiskStorage = maxOnDiskStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void testAllFields() throws JsonProcessingException, JSONException {
.useOffheap(false)
.vectorize(Vectorize.FORCE)
.vectorSize(1024)
.doAggregateTopNMetricFirst(true)
.build();

JSONObject jsonObject = new JSONObject();
Expand All @@ -101,6 +102,7 @@ public void testAllFields() throws JsonProcessingException, JSONException {
jsonObject.put("serializeDateTimeAsLong", true);
jsonObject.put("serializeDateTimeAsLongInner", true);
jsonObject.put("minTopNThreshold", 10);
jsonObject.put("doAggregateTopNMetricFirst", true);
jsonObject.put("skipEmptyBuckets", true);
jsonObject.put("maxMergingDictionarySize", 65536L);
jsonObject.put("maxOnDiskStorage", 262144L);
Expand Down