Open amitchopraait opened 3 years ago
Just to think about this problem.
I feel we need to pre-define the granularity of segment metadata, then in the broker routing strategy, we can implement the hierarchy of segments with different time granularity. And of course, the time boundary should be aligned always.
Then for each query, we can parse the time range from the query then pick the right segments to cover the entire time range.
Apart from generating roll-up segments, have you tried Star-tree for this metrics aggregation use case? Though this is still at single-segment level. https://docs.pinot.apache.org/basics/indexing/star-tree-index
Our use case is to provide users with capability to slice and dice data over varying time intervals. The user may look at certain metric over last month and then zoom in to a specific week, day or hour to further analyze the data.
For this we plan to store raw segments, as well have rollup jobs (using minion) to have aggregated data for day, month etc. With this, we will only lose the granularity of the time column but will not lose any of the old dimensions.
To take an example:
But if we rollup the data to hour granularity from second granularity in the above example, we will have the following data in rolled up segment. As you can see, no loss of dimensions, only loss of granularity of time:
Now, given these raw as well rolled up segments (for day, week, hour), it would be great if the broker can understand and decide which segment to use, depending on the query time interval.
Also attached a diagram to show the rollup and smart query pictorially