Repository navigation
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? |
|
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: 93673814b48e7d205b9dc518c0812fbc9b068efb
Assessment: request_changes
Reviewed the complete four-file delta and affected callers. Keeping expression expansion in the EXPLAIN renderer is appropriate, but the implementation rejects valid multi-target UPDATE plans.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
- P2
pkg/sql/plan/explain/sql_json.go:951: EXPLAIN FORMAT=JSON UPDATE nation n JOIN region r ON n.n_regionkey = r.r_regionkey SET n.n_regionkey = 2, r.r_name = 'changed'; updating two aliases of the same table also reproduces the failure.
Impact: Previously accepted JSON EXPLAIN statements now fail with "cannot resolve row-image expression for column n_nationkey". Handle producer-specific outputs before treating unnamed references as malformed, and add multi-target planner regressions.
Evidence: The new recursion assumes every unnamed column references a child projection. The real multi-target plan reaches a SINK_SCAN output with SourceStep but no children; the self-join variant reaches an aggregate output at RelPos=-2. Neither resolves through the implemented lookup. Both queries optimize successfully, then fail rendering in TestReviewSharedDMLAndDistinctProducers. Identical tests pass with only the merge-base formatter substituted. Candidate receipt: checks/1791955864330931951-3.json (exit 1); baseline control: checks/1791955901730202330-5.json (exit 0). Logs: shared-probe.jsonl and base-shared-probe.jsonl.
Validation:
-
All changed unit regressions and eight additional UPDATE producer-shape probes passed. INSERT, REPLACE, ON DUPLICATE and DISTINCT controls also passed.
-
Isolation preflight passed. Verified compatibility of 192 native build inputs and 62 retained artifacts before testing.
-
Commands, source fingerprints, overlays, exit receipts and logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/9e973011225a06ca4c953c15/attempt-1/validation-summary.json. Source remained unchanged.
-
Reviewed exact-head green CI statuses and author validation claims. Added traversal/allocation affects JSON EXPLAIN, not normal SQL execution; no performance benchmark was run.
Limitations:
-
Local reproduction uses production parser, optimizer and renderer entry points, not a fresh network client. Baseline control substitutes only sql_json.go.
-
Raw CI/author logs and the linked issue's full body were not supplied; local_validation was empty.
-
Source review is complete. Corrected multi-target rendering and corresponding SQL regressions require validation before approval.
aptend
left a comment
There was a problem hiding this comment.
Deep re-review of exact head 9e5084e35bda23d1ef8eef719d6cf8a528de8947, base/merge-base fcad62a8ff06000e682824802f1155cbeea02a2f: APPROVE. No actionable blocker found.
Read the complete five-file delta, the prior REQUEST_CHANGES at 93673814b48e7d205b9dc518c0812fbc9b068efb, its incremental repair, all conversation comments and #30130. There are no inline comments or review threads. This is a focused repair to the existing accepted JSON EXPLAIN contract; the display-only UNION lineage clarification matches the implementation.
The prior multi-target blocker is closed: SINK_SCAN now follows its source step, AGG handles pruned grouping/aggregate slots, WINDOW resolves its output in producer context, and UNION preserves both branch alternatives instead of selecting one. I checked planner remapping conventions and the public EXPLAIN caller. Child-relative inputs, logical binding fallback, named terminals, function/list/window containers, cycles, malformed inputs and cancellation were inspected. Expansion clones expression containers and does not rewrite the execution plan or change the result schema. There is no new background work, shared cache, resource owner or wait protocol.
Independent exact-head validation in a detached worktree with CGO enabled:
- Full explain package passed: 137 roots / 410 named results, no skips, 0.234s. Committed planner tests cover both prior failures (different tables and two aliases of one table).
- Nine additional real parser/optimizer/renderer UPDATE shapes passed, including multi-target joins, arithmetic/COALESCE/CASE, grouped and window-derived inputs, UNION ALL, CTEs and a scalar aggregate subquery. The plan was byte-identical before/after rendering.
- The unchanged canonical mo-tester normal comparison path ran the complete optimizer/explain_format_json.sql twice against an owned native single-CN LOG/TN/CN fixture: 134/134 successful statements each, zero failed/ignored/abnormal. This includes constant/arithmetic/NULL/prepared assignments, both multi-target cases, no-write observations and actual UPDATE result controls. Database teardown was independently checked after each round.
- A bounded real-planner CTE-chain probe at depths 4/8/12/16 did not reproduce the suspected expansion-growth issue; depth 16 was 873 SQL bytes, 25 plan nodes and 6,925 JSON bytes. This is a scoped control, not a general performance guarantee.
- Initial local harness-only password/default-database/result-path errors were corrected before the qualifying BVT run. The pinned active runner JAR SHA256 is f60ecd676ba52b8ea6b2d4f79130257929bab6057378141c90ce25aa30166a8c. Final BVT log SHA256: 9fdf5467ca774064c93ab15b51baff1e5175ea0631c68575bc85ef30519e527d.
- Canonical wrapper verified matching primary native artifacts read-only; both temporary probe files were removed, gofmt/diff checks pass, and tracked source is unchanged.
At final check, exact-head shared build, ARM64 SCA, coverage, PROXY and PESSIMISTIC BVT were successful; Ubuntu UT was still in progress. Pending/skipped checks are not counted as passes. No general EXPLAIN performance benchmark or new mixed-version qualification is claimed.
|
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: 9e5084e35bda23d1ef8eef719d6cf8a528de8947
Assessment: request_changes
Reviewed the complete five-file delta and affected callers. Keeping expansion in the EXPLAIN renderer is appropriate, and the prior multi-target failures are addressed. However, the new recursion rejects valid UPDATE assignments that consume MARK-join outputs.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0
- P2
pkg/sql/plan/explain/sql_json.go:1025: EXPLAIN FORMAT=JSON UPDATE nation n SET n_regionkey = CASE WHEN EXISTS (SELECT 1 FROM region r WHERE r.r_regionkey = n.n_regionkey) THEN 1 ELSE 0 END; CASE WHEN n.n_regionkey IN (SELECT r_regionkey FROM region) reproduces the same failure.
Impact: Previously accepted JSON EXPLAIN statements now fail with "cannot resolve row-image expression for column n_regionkey". Resolve the MARK join's generated output in its producer context and add planner/public SQL regressions.
Evidence: Both queries optimize successfully, but recursive expansion reaches an unnamed MARK output at RelPos=-1, ColPos=0, which resolveUpdateRef cannot handle. Candidate receipt checks/1791971002967599070-2.json records exit 1 with both failures; constant and composite-primary-key controls pass. Identical probes pass with the merge-base formatter: checks/1791971036055385934-2.json, exit 0. Retained logs: special-slots.jsonl and base-special-slots.jsonl.
Validation:
-
Committed explain package passed all 410 named results, with no skips; receipt checks/1791971074513477717-2.json. Its coverage misses the reproduced MARK-output cases.
-
Isolation preflight passed. Verified 192 native inputs and 62 retained artifacts against build-owner receipts and logs before testing.
-
Verified frozen source identity, clean checkout, diff formatting and correspondence of all 134 SQL/result statements. Fixture correspondence is a static check.
-
Reviewed current-head successful UT, SCA, coverage and complementary BVT statuses. Author and independent-review reports describe two successful public SQL regression runs.
-
Commands, source fingerprints, overlays, receipts and retained logs are reconciled in /home/xupeng/.local/state/mo-bot/jobs/2615c30f2ad9b8fa6da5346a/attempt-1/validation-summary.json.
Limitations:
-
Local reproduction uses production parser, optimizer and renderer with a mock catalog, not a fresh network SQL client. The baseline control substitutes the formatter and matching original test file.
-
Raw author/CI logs and the linked issue's full text were not supplied.
-
Added traversal and allocation are confined to JSON EXPLAIN rendering. No general performance benchmark was run.
9e5084e to
d0187a3
Compare
|
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: d0187a3ae3273f14da30de5013348ba94714aaca
Assessment: approve
Reviewed the complete five-file delta and affected callers. Producer-aware resolution appropriately belongs in the existing EXPLAIN renderer. It closes the prior multi-target and MARK-output failures while preserving plan immutability, JSON schema compatibility and three-valued marker semantics. No actionable findings remain. Additional traversal and allocation are confined to JSON EXPLAIN.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
Validation:
-
Full explain package plus 13 supplemental planner cases passed: 140 test roots, 438 named passes, no skips. Coverage includes combined multi-target MARK joins, recursive/sample/window sources and INSERT/REPLACE/upsert controls. Receipt: checks/1791998458852950131-2.json; log: explain-v2-check.log.
-
The initial diagnostic run rejected two exploratory queries during optimization, before the changed renderer. Corrected non-target-table inputs passed; the unsuccessful run remains recorded separately.
-
Isolation preflight passed. Verified 192 native inputs and 62 retained artifacts against build-owner evidence. Source remained unchanged.
-
Verified all 155 SQL statement lines correspond to result entries. Frozen exact-head CI reports successful UT, SCA, coverage and complementary BVT checks; the author reports two successful public SQL comparison runs.
-
Commands, source fingerprints, receipts, logs and artifact hashes are reconciled in /home/xupeng/.local/state/mo-bot/jobs/3265dfc8647d4d5a940bc4fa/attempt-1/review-evidence.json. Final audit receipt: checks/1791998566405836675-2.json.
Limitations:
-
Supplemental checks use the production parser, optimizer and renderer with a mock catalog. No fresh local mo-tester run was performed; raw author/CI execution logs were not supplied.
-
The linked issue’s full body was unavailable. No general performance benchmark was run; rendering cost can grow with expanded lineage.
Merge Queue Status
This pull request spent 12 minutes 22 seconds in the queue, with no time running CI. ReasonPull request #30139 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
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:
Please leave the issue open for the reporter to verify after merge.
What this PR does / why we need it:
EXPLAIN FORMAT=JSON UPDATE t SET v = 2currently exposes#[0,1]as the assignment value because the row image passes through a Lock Operator. Resolve anonymous row-image references in each producing node's context until the assigned expression is reached. Constant and expression assignments now display2andt.v + 1, while unchanged columns retain their source names.Multi-target UPDATE plans also resolve materialized source steps, aggregate slots, and window outputs. UNION outputs show explicit branch lineage so both aliases' expressions remain visible. Generated MARK-join outputs used by EXISTS and IN subquery assignments now render their join predicates as display-only lineage, retaining three-valued semantics and the outer IS TRUE/NOT wrappers. The resolver selects the correct input for joins and preserves column reordering, logical binding references, and nested function/list expressions. It copies expression containers before substitution and rejects cyclic or unresolved references. This only changes UPDATE assignment rendering; the JSON schema and execution plan are unchanged. Work and allocations are limited to EXPLAIN expression expansion.
Regression coverage includes real planner output, passthrough/reordered projections, join inputs, named terminals, repeated references, invalid/cyclic references, and plan immutability. The existing SQL regression now checks constant, arithmetic, NULL, and prepared UPDATE assignment values together with the existing no-write controls.
Validation on macOS arm64, Go 1.27.1:
mo-cgo-test -v -count=1 -timeout=120s ./pkg/sql/plan/explainpassed. Final focused MARK tests also passed, including multiple predicates with NULL, malformed inputs, empty predicates, cycles, cancellation, and plan immutability.go vetand golangci-lint passed (0 issues).cmd/mo-servicewith the repository native libraries and ranoptimizer/explain_format_json.sqlin mo-tester normal comparison mode twice against a fresh isolated instance: 155/155 statements each, zero ignored/abnormal. Verified database teardown after each round.Rebased onto official main
a33dcfb2e54196e17abe21de4346200a18009d83; package, static, build and both public SQL checks passed again after rebase. The starting head's required CI checks passed. CI for the repair commit will run after the update.