forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small refactor of the aggregate functions (elastic#437)
use just one method instead of two centralize the creation into Aggregator centralize the ESQL function mapping (for now) into AggregateMapper
- Loading branch information
Showing
12 changed files
with
149 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
server/src/main/java/org/elasticsearch/compute/aggregation/AggregatorFunctionProviders.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.compute.aggregation; | ||
|
||
public final class AggregatorFunctionProviders { | ||
|
||
private AggregatorFunctionProviders() {} | ||
|
||
public static AggregatorFunction.Provider avgDouble() { | ||
return DoubleAvgAggregator::create; | ||
} | ||
|
||
public static AggregatorFunction.Provider avgLong() { | ||
return LongAvgAggregator::create; | ||
} | ||
|
||
public static AggregatorFunction.Provider count() { | ||
return CountRowsAggregator::create; | ||
} | ||
|
||
public static AggregatorFunction.Provider max() { | ||
return MaxAggregator::create; | ||
} | ||
|
||
public static AggregatorFunction.Provider sum() { | ||
return SumAggregator::create; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.