-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cherry-pick commit Support intermediate aggs in Orca plans (#13707) #741
base: main
Are you sure you want to change the base?
Conversation
Orca in GPDB6 has support for intermediate aggs, which isn't used in postgres. This is useful when we have a DQA and a regular "ride-along" agg. However, we need to differentiate when we should run the combine/final/trans functions when this ride-along agg is present. This commit re-adds support for intermediate aggs. The logic here is the same as 6X, however, instead of explicitly using the aggstage, we use the aggsplit, which is determined from the aggstage. The logic is defined in `AGGSPLIT_INTERNMEDIATE`. The changes in nodeAgg.c are to allow the aggref and aggstate to differ for an aggregate. This is necessary and expected in the case of an intermediate agg, as the loop will iterate over each aggstate->aggs, but the aggsplit can now be different between the aggref and the aggstate. Thus the aggsplit references are also changed to use aggref instead of aggstate.
need waitting the |
@edespino Ed, appreciate your help on it. |
I have a branch with the changes. My repos's workflow is running: https://github.com/edespino/cloudberry/actions/runs/12115945979 |
My branch has a single commit based on this PR branch that is necessary to enable the My branch: https://github.com/edespino/cloudberry/tree/refs/heads/CherryPickOrcaFeb2023_3-ic-good-opt-on |
It seems to me that the ic-good-opt-off tests are flaky. @edespino Ed, appreciate you help. ic-good-opt-on tests from Ed branch are green. |
@leborchuk @jiaqizho We need to investigate what flaky and fix them, thanks! |
Thanks for flagging this. Since these flaky test failures involve the orca query optimizer behavior, we should first have an engineer familiar with the orca query optimizer review the test issues. Once they can determine whether this is a product issue or an environmental/infrastructure problem, I can assist with any infrastructure-related fixes needed. Please loop me back in after that assessment. |
I see here only failed
tests in Apache Cloudberry Build / ic-good-opt-off (pull_request) workflow run I'm sure they will succeed if I run them again. (I cannot do it myself; I do not have the rights to launch the tests one more time.) I opened issue to fix it - #789 |
rebase pls. ic-good-opt-on already added in CI |
hi @leborchuk, check this case pls, i think executor missing some implements.. |
Here I cherry-picked commit Jun 28, 2022 Support intermediate aggs in Orca plans (#13707) greenplum-db/gpdb-archive@5bf9fd5
This commit conflicts with 0a2bc5d Move per-agg and per-trans duplicate finding to the planner. - refactoring made by hlinnaka@
The interesting thing is that the commit is from November 24th, 2020 (which is more than a year older than the CBDB fork date) and is absent in the original gpdb repository. Also, I didn't find a PR where it was committed. It seems for me like a CBDB feature.
So I decided to create separate PR only for that commit
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
[skip ci]
to your PR title. Only use when necessary!