diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/TimeSeriesAggregate.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/TimeSeriesAggregate.java index 3a145dcd0110c..7e6a3f5caec25 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/TimeSeriesAggregate.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/TimeSeriesAggregate.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.util.List; +import java.util.Objects; /** * An extension of {@link Aggregate} to perform time-series aggregation per time-series, such as rate or _over_time. @@ -74,8 +75,35 @@ public TimeSeriesAggregate with(LogicalPlan child, List newGroupings return new TimeSeriesAggregate(source(), child, newGroupings, newAggregates, timeBucket); } + @Override + public boolean expressionsResolved() { + return super.expressionsResolved() && (timeBucket == null || timeBucket.resolved()); + } + @Nullable public Bucket timeBucket() { return timeBucket; } + + @Override + public int hashCode() { + return Objects.hash(groupings, aggregates, child(), timeBucket); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + TimeSeriesAggregate other = (TimeSeriesAggregate) obj; + return Objects.equals(groupings, other.groupings) + && Objects.equals(aggregates, other.aggregates) + && Objects.equals(child(), other.child()) + && Objects.equals(timeBucket, other.timeBucket); + } }