Skip to content

feat: add support for having clause - #1165

Closed
murex971 wants to merge 2 commits into
pgdogdev:mainfrom
murex971:nagrawal-having-clause
Closed

murex971 wants to merge 2 commits into
pgdogdev:mainfrom
murex971:nagrawal-having-clause

Conversation

@murex971

@murex971 murex971 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add support for HAVING in cross-shard GROUP BY queries.
  • Introduce HavingRewritePlan to inject hidden HAVING dependencies (when not in SELECT).
  • Update multi-shard processing order to run: aggregate -> having -> sort/distinct/limit, then drop hidden columns before returning rows/row description to clients.

Testing

Added unit and integrated tests

Related Issues

closes #695

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

@levkk

levkk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This will require a thorough review. Will try to circle back next week due to #1114 (comment)

@murex971

Copy link
Copy Markdown
Contributor Author

Note: I have added hidden column helper logic in this having clause which is a current limitation of ORDER BY

@jkaczman

Copy link
Copy Markdown
Contributor

@murex971 are you still interested in working on this? If so, do you mind taking another pass over it and fixing conflicts before I review?

@murex971

Copy link
Copy Markdown
Contributor Author

yeah, sure!

@murex971 murex971 closed this Oct 16, 2026
@murex971

Copy link
Copy Markdown
Contributor Author

moved to #1841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Query engine] Support HAVING in aggregates

3 participants