Skip to content

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Apr 2, 2025

Rate aggregators need to access the start time and end time of each group to perform extrapolation in the final evaluation. This change replaces the DriverContext parameter in evaluateFinal with EvaluationContext, allowing the TimeSeriesAggregationOperator to pass an EvaluationContext with these time intervals. I took another approach where the extension is applied only for the time series aggregator, but it could be fragile with the pre-filter of aggregators.

@dnhatn dnhatn force-pushed the generate-time-series-agg branch from 2d5dcdd to ab04dfe Compare April 2, 2025 19:12
@dnhatn dnhatn changed the title Generate time-series aggregation Add evaluation context to time-series aggregators Apr 2, 2025
@dnhatn dnhatn force-pushed the generate-time-series-agg branch 2 times, most recently from f0c3c5c to 80402d9 Compare April 2, 2025 20:00
@dnhatn dnhatn force-pushed the generate-time-series-agg branch from 80402d9 to 4a301dd Compare April 2, 2025 21:13
@dnhatn dnhatn requested review from kkrik-es, martijnvg and nik9000 April 2, 2025 23:06
@dnhatn dnhatn marked this pull request as ready for review April 2, 2025 23:06
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine labels Apr 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

private final ClassName implementation;
private final List<AggregatorImplementer.IntermediateStateDesc> intermediateState;
private final boolean includeTimestampVector;
private final boolean timseries;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/timseries/timeSeries

Copy link
Contributor

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, deferring to Nik to approve (my esql-fu is pretty elementary).

* A time-series aggregator might need more than just the DriverContext to evaluate, such as the range interval of each group.
*/
public class GroupingAggregatorEvaluationContext {
private final DriverContext driverContext;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: maybe this could be a record

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I made this a class intentionally so that we can extend for TimeSeriesGroupingAggregatorEvaluationContext.

@dnhatn
Copy link
Member Author

dnhatn commented Apr 4, 2025

@kkrik-es @idegtiarenko Thanks for reviews.

@dnhatn dnhatn merged commit 52c2d62 into elastic:main Apr 4, 2025
17 checks passed
@dnhatn dnhatn deleted the generate-time-series-agg branch April 4, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants