question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support query result post-aggregation / nested query

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
atriscommented, Jul 9, 2021

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

0reactions
surajkmthcommented, Oct 28, 2021

Any updates on this thread ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found