Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Mar 24, 2025

We will need custom logic in the time-series aggregation operator, such as smoothing the rate across buckets. To address this, this PR introduces a TimeSeriesAggregationOperator that extends HashAggregationOperator to support the addition logic.

@dnhatn dnhatn requested a review from martijnvg March 24, 2025 23:27
@dnhatn dnhatn added the :StorageEngine/TSDB You know, for Metrics label Mar 24, 2025
@dnhatn dnhatn marked this pull request as ready for review March 24, 2025 23:27
@dnhatn dnhatn requested a review from nik9000 March 24, 2025 23:28
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine labels Mar 24, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

I think this prepares to way to do the smooth the rate accross buckets.
LGTM, thanks Nhat!

@Override
public Operator get(DriverContext driverContext) {
return new HashAggregationOperator(aggregators, () -> {
if (aggregatorMode.isInputPartial()) {
Copy link
Member

Choose a reason for hiding this comment

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

Double check, currently the input is not partial during the initial grouping by tsid on data node, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct.

* An interface indicates that this is a time-series aggregator and it requires time-series source
*/
public interface ToTimeSeriesAggregator extends ToAggregator {

Copy link
Member

Choose a reason for hiding this comment

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

Is the smoothing going to be added to implementations of this interface or to TimeSeriesAggregationOperator?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this interface serves as a placeholder for detecting time-series aggregations that require _tsid and @timestamp, such as rate (last, ...).

@dnhatn
Copy link
Member Author

dnhatn commented Mar 25, 2025

Thanks @martijnvg.

@dnhatn dnhatn merged commit 3f80552 into elastic:main Mar 25, 2025
17 checks passed
@dnhatn dnhatn deleted the add-aggregate-mode branch March 25, 2025 15:16
true // we can enable optimizations as the inputs are vectors
);
} else {
return new TimeSeriesBlockHash(timestampGroup.channel(), timestampGroup.channel(), driverContext.blockFactory());
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the first arg be tsidGroup?

dnhatn added a commit that referenced this pull request Mar 26, 2025
Fix the channel in TimeSeriesAggregationOperator.

Relates #125537
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
We will need custom logic in the time-series aggregation operator, such 
as smoothing the rate across buckets. To address this, this PR
introduces a TimeSeriesAggregationOperator that extends
HashAggregationOperator to support the addition logic.
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
Fix the channel in TimeSeriesAggregationOperator.

Relates elastic#125537
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