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

Fix compilation in CumulativeCardinalityAggregatorTests #46000

Merged
merged 1 commit into from
Aug 26, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public void testAllNull() throws IOException {
}

public void testParentValidations() throws IOException {
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
ValuesSourceConfig<ValuesSource> valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);

// Histogram
Set<PipelineAggregationBuilder> aggBuilders = new HashSet<>();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
AggregatorFactory parent = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
AggregatorFactory parent = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d,
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
new AggregatorFactories.Builder(), Collections.emptyMap());
CumulativeCardinalityPipelineAggregationBuilder builder
Expand All @@ -131,14 +131,15 @@ public void testParentValidations() throws IOException {
// Date Histogram
aggBuilders.clear();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
parent = new DateHistogramAggregatorFactory("name", numericVS, 0L,
parent = new DateHistogramAggregatorFactory("name", valuesSource, 0L,
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
new AggregatorFactories.Builder(), Collections.emptyMap());
builder = new CumulativeCardinalityPipelineAggregationBuilder("name", "valid");
builder.validate(parent, Collections.emptySet(), aggBuilders);

// Auto Date Histogram
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
aggBuilders.clear();
aggBuilders.add(new CumulativeCardinalityPipelineAggregationBuilder("cumulative_card", "sum"));
AutoDateHistogramAggregationBuilder.RoundingInfo[] roundings = new AutoDateHistogramAggregationBuilder.RoundingInfo[1];
Expand Down Expand Up @@ -229,15 +230,16 @@ private static long asLong(String dateTime) {

private static AggregatorFactory getRandomSequentiallyOrderedParentAgg() throws IOException {
AggregatorFactory factory;
ValuesSourceConfig<ValuesSource> valuesSource = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
ValuesSourceConfig<ValuesSource.Numeric> numericVS = new ValuesSourceConfig<>(ValuesSourceType.NUMERIC);
switch (randomIntBetween(0, 2)) {
case 0:
factory = new HistogramAggregatorFactory("name", numericVS, 0.0d, 0.0d,
factory = new HistogramAggregatorFactory("name", valuesSource, 0.0d, 0.0d,
mock(InternalOrder.class), false, 0L, 0.0d, 1.0d, mock(SearchContext.class), null,
new AggregatorFactories.Builder(), Collections.emptyMap());
break;
case 1:
factory = new DateHistogramAggregatorFactory("name", numericVS, 0L,
factory = new DateHistogramAggregatorFactory("name", valuesSource, 0L,
mock(InternalOrder.class), false, 0L, mock(Rounding.class), mock(Rounding.class),
mock(ExtendedBounds.class), mock(SearchContext.class), mock(AggregatorFactory.class),
new AggregatorFactories.Builder(), Collections.emptyMap());
Expand Down