Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Apr 21, 2024
1 parent 02f5c14 commit 76cc193
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void setAggregationType(AggregationType aggregationType) {
}

public boolean isRewriteable(final Object parent, final int subAggLength) {
if (context.maxAggRewriteFilters() == 0) return false;
// if (context.maxAggRewriteFilters() == 0) return false;

boolean rewriteable = aggregationType.isRewriteable(parent, subAggLength);
logger.debug("Fast filter rewriteable: {} for shard {}", rewriteable, context.indexShard().shardId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ final class CompositeAggregator extends BucketsAggregator {
// bucketOrds is used for saving date histogram results
bucketOrds = LongKeyedBucketOrds.build(context.bigArrays(), CardinalityUpperBound.ONE);
preparedRounding = ((CompositeAggregationType) fastFilterContext.getAggregationType()).getRoundingPrepared();
fastFilterContext.setFieldName(sourceConfigs[0].name());
fastFilterContext.buildRanges();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ private AutoDateHistogramAggregator(
)
);
if (fastFilterContext.isRewriteable(parent, subAggregators.length)) {
fastFilterContext.setFieldName(valuesSourceConfig.fieldType().name());
fastFilterContext.buildRanges();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,6 @@ public void testNanosIntervalSecond() throws IOException {
aggregation -> aggregation.calendarInterval(DateHistogramInterval.SECOND).field(AGGREGABLE_DATE).minDocCount(1L),
histogram -> {
List<? extends Histogram.Bucket> buckets = histogram.getBuckets();
System.out.println(buckets);
assertEquals(3, buckets.size());

Histogram.Bucket bucket = buckets.get(0);
Expand Down

0 comments on commit 76cc193

Please sign in to comment.