Repository navigation
Conversation
There was a problem hiding this comment.
Review result: request changes.
Critical checkpoint conclusions:
- Goal/test proof: the PR aims to replace/extend eager aggregation pushdown, but several correctness and regression-test issues remain, including nested count propagation and stale/ineffective test hints.
- Scope/focus: the implementation is concentrated in Nereids eager aggregation and session/test plumbing, but it removes older distinct-through-join coverage without equivalent replacement.
- Concurrency/lifecycle: no new concurrent mutable state or unusual lifecycle issue was found in the reviewed paths; the shared rewrite state is per invocation.
- Configuration/session variables:
force_eager_agg_hintaffects planning but is not forwarded between FEs; the new regression suite also resetseager_aggregation_modeto a non-default value. - Compatibility/parallel paths: old
PUSH_DOWN_DISTINCT_THROUGH_JOINandPUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDEhint surfaces are left stale or untested after the rewrite migration. - Tests/results:
git diff --checkfails; oneorder_qtrecords a debugselect *instead of its aggregate query; distinct-through-join replacement coverage is missing. - Data correctness/performance: nested eager aggregation can undercount aggregates when cross/full-outer subtrees fail to publish required row-count slots.
User focus: no additional user-provided review focus was supplied.
Subagent conclusions: tests-session-config produced TEST-SESSION-1 through TEST-SESSION-4; TEST-SESSION-1/2/3/4 became MAIN-1/2/3/4. optimizer-rewrite produced OPT-RW-1 and OPT-RW-2; they became MAIN-5 and MAIN-8. MAIN-6 and MAIN-7 were added by the main pass. Convergence round 1 found OPT-RW-2, so the round was repeated; convergence round 2 ended with both live subagents reporting NO_NEW_VALUABLE_FINDINGS for the MAIN-1..MAIN-8 comment set.
| private int eagerAggregationMode = 0; | ||
|
|
||
| @VarAttrDef.VarAttr(name = "force_eager_agg_hint", setter = "setForceEagerAggHint", | ||
| description = { |
There was a problem hiding this comment.
force_eager_agg_hint affects Nereids rewrite decisions, but it is not forwarded when a statement is proxied to another FE. getForwardVariables() only includes variables marked needForward, affectQueryResultInPlan, or affectQueryResultInExecution, and FEOpExecutor sends exactly that map to ConnectProcessor.proxyExecute. Since this annotation has none of those flags, the target FE sees the default empty hint map in EagerAggHints.currentHints() and can generate a different plan from the origin FE. Please mark this variable for forwarding/result-plan propagation and add a forward/restore assertion to SessionVariablesTest.
| insert into t_pdajos_1 values(1,10),(1,20),(2,30); | ||
| insert into t_pdajos_2 values(1,100),(1,200),(2,300); | ||
|
|
||
| drop table if exists pdagg_proj_t1; |
There was a problem hiding this comment.
This new suite currently fails git diff --check: trailing whitespace is reported here and at several later lines in this file, and the generated .out has an extra blank line at EOF. Please strip the trailing spaces and regenerate or clean the output file so the repository whitespace check passes.
|
|
||
|
|
||
| order_qt_sum_to_2_side """ | ||
| select t2.k, sum(if(t1.x==0,t1.y,t2.v)),sum(t1.y) |
There was a problem hiding this comment.
This order_qt block contains two statements: the aggregate query and then select * from pdagg_proj_t2. The generated -- !sum_to_2_side -- output is the four raw pdagg_proj_t2 rows, so the test is not checking the aggregate result it is named for. Please remove/split the debug select * and regenerate the .out so this eager-aggregation case is actually asserted.
|
|
||
| costBased(custom(RuleType.PUSH_DOWN_DISTINCT_THROUGH_JOIN, PushDownDistinctThroughJoin::new)), | ||
| costBased(topDown(new PushDownAggWithDistinctThroughJoinOneSide())), | ||
| custom(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN, PushDownAggregation::new), |
There was a problem hiding this comment.
This removes the old PushDownDistinctThroughJoin rewrite from the eager-aggregation stage, but the PR also deletes its unit/regression coverage and does not add equivalent coverage for the new context.getAggFunctions().isEmpty() path inside PushDownAggregation. The old regression also covered USE_CBO_RULE(push_down_distinct_through_join)/NO_USE_CBO_RULE(...), while PUSH_DOWN_DISTINCT_THROUGH_JOIN still remains in the hint blacklist. Please add replacement coverage for pure distinct-through-join and either preserve/redirect the old hint behavior or remove the stale hint surface intentionally.
| Optional<Slot> leftCountSlot, Optional<Slot> rightCountSlot, PushDownAggContext context) { | ||
| JoinType joinType = join.getJoinType(); | ||
| if (joinType.isInnerJoin()) { | ||
| if (leftCountSlot.isPresent() && rightCountSlot.isPresent()) { |
There was a problem hiding this comment.
needOutputCountForJoinChild() asks children of both inner and cross joins to produce a count slot, but computeJoinCount() only builds that slot for INNER_JOIN. For a multi-level cross join such as agg(sum(t1.v), sum(t2.v), sum(t3.v) group by t1.k) -> CrossJoin(CrossJoin(t1, t2), t3), the upper join needs the left subtree's row count to multiply sum(t3.v). The lower cross join registers no count slot here, so the upper project cannot recover that multiplicity and undercounts the right-side aggregate. Please handle CROSS_JOIN the same way as inner join when computing joinCnt, and add a multi-level cross-join regression.
| sql "set force_eager_agg_hint='count:t1.v=nopush;sum:t2.v=push;sum:t3.v=nopush';" | ||
| order_qt_count_nopush_other_push """ | ||
| SELECT /*+ NO_USE_CBO_RULE(PUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDE) */ | ||
| t1.k, |
There was a problem hiding this comment.
This hint names PUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDE, but this PR removes that rewrite job from Rewriter; the active replacement is PUSH_DOWN_AGG_THROUGH_JOIN via PushDownAggregation. CostBasedRewriteJob only applies NO_USE_CBO_RULE when the current job's RuleType matches the hint name, so this hint is unused and does not disable the new eager-aggregation path. Please update the hint to the active rule or remove it and regenerate the expected output; the same stale hint appears again below.
|
|
||
| // Reset session variables to defaults | ||
| sql "SET eager_aggregation_mode = -1;" | ||
| sql "SET force_eager_agg_hint = '';" |
There was a problem hiding this comment.
This reset leaves the session in eager_aggregation_mode = -1, but the default in SessionVariable is 0; -1 explicitly disables eager aggregation. If the regression connection is reused after this suite, later cases inherit a non-default planner setting. Please reset this back to 0 (and regenerate output only if needed).
| return rightCountSlot; | ||
| } | ||
| return Optional.empty(); | ||
| } |
There was a problem hiding this comment.
A rewritten FULL_OUTER_JOIN can be asked to publish a subtree row-count slot when it is the child of an upper bilateral join. One-side pushdown through full outer is still allowed when the aggregate references that side, but computeJoinCount() has no full-outer branch and falls through to Optional.empty(), so the upper join cannot multiply the opposite branch by the full-outer subtree cardinality. For example, agg(sum(t1.v), sum(t3.v)) -> InnerJoin(FullOuterJoin(t1,t2), t3) can leave sum(t3.v) unmultiplied by the rows produced by the full outer subtree. Please either compute the full-outer joinCnt from the available child counts or block count-dependent nested pushdown through full outer joins, and add a regression for this shape.
|
Closing temporary validation PR after collecting review and Litefuse evidence. |
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary: The Codex review workflow now enters goal mode through the runner's --goal invocation, so the review instructions should describe the completion criteria and convergence process instead of telling the model to create the goal itself. This change keeps the shared-ledger subagent process, final convergence requirement, GitHub review verification, xhigh reasoning setting, and Litefuse trace input path aligned with the validated workflow behavior.
### Release note
None
### Check List (For Author)
- Test: Manual test
- Verified the two committed files match fresh origin validation base commit ca89739.
- Ran workflow YAML parsing locally.
- Ran git diff --check for the committed files.
- Validated on origin PR #49 via workflow run 27895281133, which succeeded, submitted 8 inline review comments, and uploaded Litefuse trace c3078f147a04f9ead1ddb64ba02562fb with no missing I/O.
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve? Problem Summary: I modified the codex to support the `codex exec --goal` mode. The Codex review workflow now enters goal mode through the runner's --goal invocation, so the review instructions should describe the completion criteria and convergence process instead of telling the model to create the goal itself. see modification in https://github.com/zclllyybb/codex/tree/codex-exec-goal Verification: - Before: #63690 got 1 comment when `/review` - Now: zclllyybb#49 replicated the same PR, receiving 8 comments in a single `/review`
Fresh validation PR for the Codex review prompt experiment.\n\nBase branch contains only the current code-review skill and runner YAML prompt changes. Head branch replays the PR #48 eager aggregation target diff so the automated review starts without existing review threads.