Skip to content

Commit 47b46b8

Browse files
committed
remove call to substitute surrogates for avg/_over_time
1 parent c5c1b00 commit 47b46b8

File tree

1 file changed

+0
-8
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis

1 file changed

+0
-8
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.elasticsearch.xpack.esql.core.util.Holder;
5050
import org.elasticsearch.xpack.esql.core.util.StringUtils;
5151
import org.elasticsearch.xpack.esql.expression.NamedExpressions;
52-
import org.elasticsearch.xpack.esql.expression.SurrogateExpression;
5352
import org.elasticsearch.xpack.esql.expression.UnresolvedNamePattern;
5453
import org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry;
5554
import org.elasticsearch.xpack.esql.expression.function.FunctionDefinition;
@@ -2005,13 +2004,6 @@ private LogicalPlan doRule(Aggregate plan) {
20052004
aborted.set(Boolean.TRUE);
20062005
return aggFunc;
20072006
}
2008-
if (aggFunc instanceof Avg || aggFunc instanceof AvgOverTime) {
2009-
// This is related to a known bug involving AvgOverTime and aggregate_metric_double. We substitute
2010-
// surrogates here so when AvgOverTime becomes Div(SumOverTime, CountOverTime), which then becomes
2011-
// Div(SumOverTime(agg_metric.sum), SumOverTime(agg_metric.count)), we can distinguish between the
2012-
// SumOverTimes produced here from references to Sum/CountOverTime in other parts of the query
2013-
return ((SurrogateExpression) aggFunc).surrogate();
2014-
}
20152007
Map<String, Expression> typeConverters = typeConverters(aggFunc, fa, mtf);
20162008
if (typeConverters == null) {
20172009
aborted.set(Boolean.TRUE);

0 commit comments

Comments
 (0)