public class PostAggregationEvaluator extends Object implements org.apache.calcite.util.ReflectiveVisitor
calculate(PostAggregation, Function)
.Constructor and Description |
---|
PostAggregationEvaluator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Number |
calculate(PostAggregation postAggregation,
Function<String,String> aggregatedValues)
Calculates the value of a post aggregation.
|
Double |
evaluate(ArithmeticPostAggregation arithmeticPostAggregation,
Function<String,String> aggregatedValues)
Evaluates an arithmeticPostAggregation by performing it's operation over other postAggregations.
|
Double |
evaluate(ConstantPostAggregation constantPostAggregation,
Function<String,String> aggregatedValues)
Evaluates a constantPostAggregation by reading it's value.
|
Double |
evaluate(FieldAccessorPostAggregation fieldAccessorPostAggregation,
Function<String,String> aggregatedValues)
Evaluates a fieldAccessorPostAggregation by parsing the value from the aggregatedValues map.
|
Double |
evaluate(PostAggregation postAggregation,
Function<String,String> aggregatedValues)
Top level evaluation of a postAggregation which evaluates all inner
PostAggregation
and returns the value. |
public Number calculate(PostAggregation postAggregation, Function<String,String> aggregatedValues)
postAggregation
- The post aggregation to evaluate.aggregatedValues
- A map from fieldNames of aggregated values to their actual value.UnsupportedOperationException
- for PostAggregations which couldn't be processed.public Double evaluate(PostAggregation postAggregation, Function<String,String> aggregatedValues)
PostAggregation
and returns the value.postAggregation
- The post aggregation to evaluate.aggregatedValues
- A map from fieldNames of aggregated values to their actual value.UnsupportedOperationException
- for PostAggregations which couldn't be processed.public Double evaluate(FieldAccessorPostAggregation fieldAccessorPostAggregation, Function<String,String> aggregatedValues)
fieldAccessorPostAggregation
- Determines which fields value will be accessed. The field must be in the
`aggregatedValues` which will parse the value returned as a double.aggregatedValues
- A map from fieldNames of aggregated values to their actual value.public Double evaluate(ArithmeticPostAggregation arithmeticPostAggregation, Function<String,String> aggregatedValues)
arithmeticPostAggregation
- The post aggregation which performs an operation over other post aggregations.aggregatedValues
- A map from fieldNames of aggregated values to their actual value.public Double evaluate(ConstantPostAggregation constantPostAggregation, Function<String,String> aggregatedValues)
constantPostAggregation
- Contains a constant which will be read.aggregatedValues
- A map from fieldNames of aggregated values to their actual value.Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.