Repository navigation
fix(vector): preserve constant selection grouping metadata - #30119
Conversation
aptend
left a comment
There was a problem hiding this comment.
Reviewed exact head 40a84030bcbac7573090e7cfd00fbf96e57472f2 against merge-base 2ce4e58af6f03b943ee288ffad81012766cf830a. No blocking issue found. Read all six changed files, issue #30118, PR discussion and review/thread history (no prior substantive reviews or threads). This is a narrowly scoped metadata-copy correctness fix; no separate design-approval gate is needed.
The root correction in pkg/container/vector/vector.go preserves grouping per logical source row for constant Union/UnionInt32 selections and UnionBatch offset/flags selections. Constant payload does not imply uniform grouping. Checked repeated/out-of-order selections, preserved destination prefixes, exclusion of out-of-range source bits, NULL/value independence and the retained uniform-grouping range path. Traced preflight bitmap admission and preflighted publication, Batch.Clone, LoopJoin bulk/resumed projection, unique INNER HashJoin and SEMI/ANTI membership projection after removal of the scalar guard. No new ownership, wait, wire-format or schema contract is introduced; existing bitmap admission and cleanup owners remain in place.
Independent exact-head validation in an isolated worktree, using a fresh top-level make -j4 cgo build and the provenance-checked mo-cgo-test wrapper with CGO enabled:
- Full normal suites: vector 0.659s, batch 0.032s, HashJoin 4.435s, LoopJoin 0.118s, Product 0.046s; all PASS.
- Focused original grouping/clone/unique-join/membership/operator-resume tests plus my boundary probe,
-race -count=10: vector 1.817s, batch 1.056s, HashJoin 9.859s, LoopJoin 1.157s; all PASS. - Independent 24-case scalar-
UnionOneoracle covers fixed/string/NULL/rollup constants, 193 logical rows, grouping around 63/64 and 127/128, 61-row prefixes, repeated nonmonotonic selection, offsets, sparse/empty flags, two append rounds and preflighted publication. Verifies exact grouping cardinality, values/NULLs, unchanged source and zero retained MPool/allocation-account metadata after cleanup. Probe SHA-256d97bb466d0f0f8f182c53f6595b5dc09ae5b70faea75fcd91154b9f6264146a4; temporary probe removed. - Formatting and
git diff --checkpass. Exact-head CI run 38696798163 is successful; downloaded its UT log for corroboration.
These checks establish internal vector metadata and actual operator behavior; I am not claiming a newly reproduced public-SQL wrong result, persisted-data issue, performance benchmark or local multi-CN execution. Rechecked open/non-draft state and the exact head immediately before submission.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 40a84030bcbac7573090e7cfd00fbf96e57472f2
Assessment: approve
Reviewed all six changed files and affected callers. The fix correctly preserves logical-row grouping in shared vector copies and removes the obsolete HashJoin fallback. Ownership, cleanup, compatibility and ordinary fast paths remain intact. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Exact-head normal suites passed for vector, batch, HashJoin, LoopJoin and Product: 1,151 named PASS results, zero failures or skips.
-
Confirmed execution of new grouping regressions, existing SEMI/ANTI membership cases and allocation-failure controls.
-
Verified source identity, formatting, native-build inputs, command/exit receipts and retained logs. Evidence: /home/xupeng/.local/state/mo-bot/jobs/ce63883e2e012a0bc71df3a6/attempt-1/validation-summary.json; detailed assessment: review-report.md.
-
Supplied exact-head CI reports successful UT, SCA, coverage and BVT checks.
Limitations:
-
External raw test logs and the linked issue body were not supplied; reported external validation is distinguished from independently executed checks.
-
No local race rerun, public-SQL reproduction or performance benchmark was performed. Additional partial-grouping work is bounded by selected rows.
Merge Queue Status
This pull request spent 2 hours 40 minutes 39 seconds in the queue, with no time running CI. ReasonPull request #30119 has been merged manually at bac18ed HintYou were too fast! Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes
Fixes #30118.
What this PR does / why we need it:
Further exploration found that the original unique INNER JOIN grouping defect comes from constant-vector selection copies, not just JOIN projection.
unionTandunionBatchpreserve all-row uniform grouping but drop partial logical-row grouping. This also affects Batch.Clone and LoopJoin's bulk build projection.Fix the underlying vector copies: map partial grouping bits through the selection/offset/flags while keeping uniform grouping's range fast path. Remove the temporary unique-projection scalar helper and the now-unnecessary membership scalar guard; retain bulk JOIN projection.
Add Go UT for vector copies, Batch.Clone, LoopJoin scalar/range/actual operator resume, and unique HashJoin. No BVT or golden changes.
Original validation (before the 2026-10-14 base sync)
35c8dd5854750ef96f52f9dd298a70acd031d5e4, macOS arm64.-race -count=10after the root fix.make err-checkandgit diff --checkpass.This proves an internal vector metadata defect. No public SQL wrong-result, persistence or multi-CN reproduction is claimed.
2026-10-14 follow-up
Merged official main
2ce4e58af6f03b943ee288ffad81012766cf830a. Main already contains the JSON EXPLAIN compilation repair and updated logservice port fixtures; this PR no longer waits for #30106 to supply an EXPLAIN repair. The diff against main remains the six vector/batch/JOIN implementation and regression-test files.Validation of merge commit
6c7efa7ee7on macOS arm64, using the repository's native-artifact provenance guard andmo-cgo-testwrapper:git diff --check: passed.The earlier race/repetition evidence above describes the original implementation validation, not a new race run after this merge. No BVT, external test environment, or manual CI workflow was started in this follow-up. The PR remains draft; remote checks must validate the new head.