Support query result post-aggregation / nested query
See original GitHub issueFollowing 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
- Perform post-aggregation client-side (provided that cardinality is lowish)
- Use Presto
@Jackie-Jiang @mayankshriv: Feel free to edit the title & content
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Support query result post-aggregation / nested query #7043
In order to do general post-aggregation and nest query, we should build another set of operators on broker side that work on ResultTable...
Read more >How To Use Nested Queries in SQL | DigitalOcean
In this tutorial, you will use nested queries with the SELECT , INSERT , and DELETE statements. You will also use aggregate functions...
Read more >Accessing aggregate in nested subquery - sql - Stack Overflow
One way would be to run a window function over the aggregate function in a subquery: SELECT order_id, sumtotal FROM ( SELECT order_id ......
Read more >Writing Subqueries in SQL | Advanced SQL - Mode Analytics
Subqueries (also known as inner queries or nested queries) are a tool for performing operations in multiple steps. For example, if you wanted...
Read more >Nested aggregation: make ordered computations in a single ...
With nested aggregation, you can complete a NRQL query, then make additional computations using the results of that query. Nested aggregation provides NRQL ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Jackie-Jiang If it makes sense, I would like to start working on this.
Any updates on this thread ?