pinot icon indicating copy to clipboard operation
pinot copied to clipboard

Support query result post-aggregation / nested query

Open MrNeocore opened this issue 5 years ago • 9 comments

Following Slack discussion : https://apache-pinot.slack.com/archives/C011C9JHN7R/p1623346401028100

Data date | 01 | 02 | 03 entity1 | 1 | 2 | 3 entity2 | 3 | 4 | 5

Goal Aggregate data in "2 dimensions", first per entity (say, AVG), then per date (say, SUM)

This use case appears to be solvable using generic nested queries or an improvement to the existing post-aggregation feature.

Nested query example (not currently possible) SELECT SUM(agg_value) FROM (SELECT dateString, AVG(value) as agg_value FROM table GROUP BY dateString)

Workarounds

  1. Perform post-aggregation client-side (provided that cardinality is lowish)
  2. Use Presto

@Jackie-Jiang @mayankshriv: Feel free to edit the title & content

MrNeocore avatar Jun 10 '21 18:06 MrNeocore

In order to do general post-aggregation and nest query, we should build another set of operators on broker side that work on ResultTable (row major table). Currently all the operators on the server side works on the DataSource which is column major.

Jackie-Jiang avatar Jul 02 '21 18:07 Jackie-Jiang

@Jackie-Jiang If it makes sense, I would like to start working on this.

atris avatar Jul 09 '21 23:07 atris

At LinkedIn, we are exploring a combined design for subqueries and distributed joins since design / architecture wise there might be overlap and it is good to think of both design wise. cc @amrishlal @jackjlli Once we have had some preliminary thought / initial design, we will share with community to iterate upon and collaborate further.

siddharthteotia avatar Jul 12 '21 23:07 siddharthteotia

https://github.com/apache/incubator-pinot/issues/5664

siddharthteotia avatar Jul 12 '21 23:07 siddharthteotia

@siddharthteotia Thats great to hear. I am already working on this feature, since its crucial for our evaluation of Pinot. I would request your inputs and feedback on the proposed design and lets ensure alignment with your overall plans for Joins (I plan to publish today).

atris avatar Jul 13 '21 05:07 atris

any updates on this thread? post aggregation would be very useful.

pjpringle avatar Oct 11 '21 13:10 pjpringle

Any updates on this thread ?

surajkmth avatar Oct 28 '21 13:10 surajkmth

Any updates on this thread ?

shuitai avatar Jun 08 '23 00:06 shuitai

This is supported with multi-stage engine

Jackie-Jiang avatar Aug 28 '24 00:08 Jackie-Jiang