Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[timeseries] Remove Time Series Specific Code from V1 Engine #14841

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ankitsultana
Copy link
Contributor

@ankitsultana ankitsultana commented Jan 19, 2025

Description

Removes Time Series specific code from Pinot's V1 Engine, and instead leverages a Transform function and an Aggregation function to implement the leaf stage for Time Series queries.

This helps us take advantage of the speed that GroupByOperator and AggregationOperator, while at the same time, allows Time Series languages to define how they want their series to built.

This also greatly simplifies the Time Series code, as can be seen by the fact that this PR removes a ton of code.

Series Limit Handling

Series limit are now handled via standard Group By limits as defined here.

API Changes

BaseTimeSeriesBuilder has a new method called buildWithTagOverrides. This is because the GroupByOperator materializes Group values lazily to avoid excessive allocations.

Future Work

  • In the next PR I'll add support for accepting series limit per-request, since callers would want to set them based on the number of time buckets that users have in their query.
  • I'll also add support for returning warnings in a TimeSeriesBlock, and propagate the group limit reached warning to the caller.
  • In the next few months we'll also add support for Exemplars

@ankitsultana ankitsultana added the timeseries-engine Tracking tag for generic time-series engine work label Jan 19, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 64.86486% with 78 lines in your changes missing coverage. Please review.

Project coverage is 63.76%. Comparing base (59551e4) to head (ae24178).
Report is 1594 commits behind head on master.

Files with missing lines Patch % Lines
...gation/function/TimeSeriesAggregationFunction.java 66.66% 30 Missing and 3 partials ⚠️
...ery/runtime/timeseries/LeafTimeSeriesOperator.java 0.00% 14 Missing ⚠️
...c/main/java/org/apache/pinot/tsdb/spi/AggInfo.java 23.52% 11 Missing and 2 partials ⚠️
...e/operator/timeseries/TimeSeriesOperatorUtils.java 77.77% 4 Missing and 4 partials ⚠️
...rm/function/TimeSeriesBucketTransformFunction.java 87.50% 4 Missing ⚠️
...untime/timeseries/TimeSeriesPhysicalTableScan.java 0.00% 3 Missing ⚠️
...imeseries/PhysicalTimeSeriesServerPlanVisitor.java 71.42% 1 Missing and 1 partial ⚠️
...e/pinot/tsdb/spi/series/BaseTimeSeriesBuilder.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14841      +/-   ##
============================================
+ Coverage     61.75%   63.76%   +2.01%     
- Complexity      207     1611    +1404     
============================================
  Files          2436     2703     +267     
  Lines        133233   151188   +17955     
  Branches      20636    23341    +2705     
============================================
+ Hits          82274    96402   +14128     
- Misses        44911    47551    +2640     
- Partials       6048     7235    +1187     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.71% <64.86%> (+2.00%) ⬆️
java-21 63.65% <64.86%> (+2.02%) ⬆️
skip-bytebuffers-false 63.73% <64.86%> (+1.98%) ⬆️
skip-bytebuffers-true 63.62% <64.86%> (+35.89%) ⬆️
temurin 63.76% <64.86%> (+2.01%) ⬆️
unittests 63.75% <64.86%> (+2.01%) ⬆️
unittests1 56.31% <64.86%> (+9.42%) ⬆️
unittests2 34.06% <1.35%> (+6.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/**
* Used by the leaf stage, because the leaf stage materializes tag values very late.
*/
public abstract TimeSeries buildWithTagOverrides(List<String> tagNames, Object[] tagValues);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@raghavyadav01 : this one change will be required in series builders. This should do the build, AND use the provided tag names and values for the new series. See other builders in this PR for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timeseries-engine Tracking tag for generic time-series engine work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants