fix(plan): avoid shuffle for replace capture dedup join - #24502
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
aunjgr
left a comment
There was a problem hiding this comment.
Review: disable shuffle for OldColCapture dedup joins
Approve.
No blocking issues found. The change correctly prevents DEDUP joins with OldColCaptureList from being planned as shuffle joins, avoiding the unsupported compile path that would panic for shuffle OldColCapture dedup joins.
The added tests cover both the generic dedup shuffle decision and the actual REPLACE capture-plan shape with large build-side stats.
Merge Queue Status
This pull request spent 1 hour 2 minutes 13 seconds in the queue, including 1 hour 58 seconds running CI. Required conditions to merge
|
…to 4.0-dev) (#24518) Cherry-pick #24502 to `4.0-dev`. `REPLACE INTO ... SELECT ... FROM` can build a DEDUP join with `OldColCaptureList` on the merged main-table scan path. For large source scans, the planner could still mark that DEDUP join as shuffle, but the compile layer does not support shuffle DEDUP joins with old-column capture and fails with: ```text shuffle DedupJoin with OldColCapture is not supported ``` This PR disables shuffle planning for DEDUP joins that carry `DedupJoinCtx.OldColCaptureList`, keeping those REPLACE plans on the supported non-shuffle capture path. The existing `OldColList` guard is preserved. Cherry-picked commit: - 66f9089 `fix(plan): avoid shuffle for replace capture dedup join` Validation: - Not run locally for this cherry-pick PR. Approved by: @aunjgr, @XuPeng-SH
…#24502) `REPLACE INTO ... SELECT ... FROM` can build a DEDUP join with `OldColCaptureList` on the merged main-table scan path. For large source scans, the planner could still mark that DEDUP join as shuffle, but the compile layer does not support shuffle DEDUP joins with old-column capture and fails with: ```text shuffle DedupJoin with OldColCapture is not supported ``` This PR disables shuffle planning for DEDUP joins that carry `DedupJoinCtx.OldColCaptureList`, keeping those REPLACE plans on the supported non-shuffle capture path. The existing `OldColList` guard is preserved. Tests added: - cover plain large DEDUP joins still being eligible for shuffle - cover `OldColList` and `OldColCaptureList` disabling shuffle - cover the actual REPLACE merged-scan plan shape so capture DEDUP joins do not become shuffle plans Validation: - `go test ./pkg/sql/plan -run 'TestReplaceCaptureList|TestReplaceCaptureDedupJoinDoesNotShuffle|TestDetermineShuffleForDedupJoin' -count=1`\n- `go test ./pkg/sql/plan -count=1`\n- `git diff --check`\n- `make`\n- `make static-check` Approved by: @aunjgr
What type of PR is this?
Which issue(s) this PR fixes:
issue #24472
What this PR does / why we need it:
REPLACE INTO ... SELECT ... FROMcan build a DEDUP join withOldColCaptureListon the merged main-table scan path. For large source scans, the planner could still mark that DEDUP join as shuffle, but the compile layer does not support shuffle DEDUP joins with old-column capture and fails with:This PR disables shuffle planning for DEDUP joins that carry
DedupJoinCtx.OldColCaptureList, keeping those REPLACE plans on the supported non-shuffle capture path. The existingOldColListguard is preserved.Tests added:
OldColListandOldColCaptureListdisabling shuffleValidation:
go test ./pkg/sql/plan -run 'TestReplaceCaptureList|TestReplaceCaptureDedupJoinDoesNotShuffle|TestDetermineShuffleForDedupJoin' -count=1\n-go test ./pkg/sql/plan -count=1\n-git diff --check\n-make\n-make static-check