Repository navigation
fix(frontend): keep computed bool metadata numeric - #30191
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? |
|
Reviewed head [P2] Missing origin metadata does not establish that a BOOL is computedLocation:
Minimal reproduction: CREATE TABLE t (id INT PRIMARY KEY, flag BOOLEAN);
INSERT INTO t VALUES (1, TRUE), (2, FALSE), (3, NULL);
SELECT flag FROM t;
SELECT DISTINCT flag FROM t ORDER BY flag;
SELECT flag FROM t UNION ALL SELECT flag FROM t;I tested the exact PR head with real Connector/J 8.0.30, Please distinguish computed predicates from retained native BOOLEAN values independently of the origin/key-flag fields. Do not restore key flags through DISTINCT/UNION just to make this heuristic pass. Add real planner/wire regressions for native BOOLEAN DISTINCT and UNION ALL, alongside computed predicate controls, for ordinary and prepared queries. The new hand-built The intended fix does work for the tested direct predicates and the Metabase-style |
|
@XuPeng-SH Addressed review 5568831875 in Root cause and fix: a remapped SAMPLE Regression coverage:
Validation on the final source (Go 1.27.1, darwin/arm64):
Separate exploratory failure, not included in the passing counts: No full Metabase replay, mixed-version certification or throughput claim is made. This commit does not alter the unrelated 15-second UT scheduling fixture discussed in the previous CI diagnosis. Fresh CI and reviewer reassessment remain pending; previous request-changes reviews have not been dismissed. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 8803a292e60f15cde7a9739c45e8368647d68438
Assessment: request_changes
Reviewed all 38 changed files and supplied discussion. Planner-owned provenance and the non-BOOLEAN fast path are reasonable, and the latest SAMPLE correction passes real JDBC validation. One confirmed TIME_WINDOW mapping defect remains: grouped INTERVAL queries reverse stored and computed BOOLEAN metadata.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/sql/plan/result_column_kind.go:288: For t(ts TIMESTAMP, flag BOOLEAN, n INT), execute SELECT flag, MAX(n>0) FROM t GROUP BY flag INTERVAL(ts,1,MINUTE), including with reversed projection order.
Impact: Stored flag is advertised as numeric and returned by Connector/J as Integer, breaking stored-BOOLEAN compatibility. MAX(n>0) is advertised as BOOLEAN and returned as Boolean, leaving the computed-result contract unsatisfied. Statement, client-prepared and verified server-prepared execution all reproduce this.
Evidence: The fallback follows child columns using unchanged ordinals. TIME_WINDOW emits aggregates before partition keys, whereas its child AGG places group keys first. Here, aggregate slot 0 follows stored flag and partition slot 1 follows computed time truncation. Packet widths are [8,1], expected [1,8]. Resolve provenance through existing BuildTimeWindowLayout, AggList and TimeWindowPartitionBy mappings, with regression coverage for reordered projections, boundaries and FILL. time-window-confirm.log and TimeWindowBooleanProbe.log reproduce the defect; receipts checks/1792403553275081326-4.json and checks/1792403736849772626-3.json both record exit 1. Ordinary GROUP BY controls pass.
Validation:
-
Artifacts are retained under /home/xupeng/.local/state/mo-bot/jobs/f85540f6956c581ff52ec302/attempt-1. evidence-index.json reconciles all 14 command/source/exit receipts with logs and input hashes; review-record.json records the complete review.
-
Isolation preflight passed. Repository-owned native build passed; final audit verified 197 input hashes, seven native output hashes, exact HEAD and unchanged source.
-
54 selected committed test roots passed across planner, frontend, compile, objectio, SQL integration and upgrade packages (receipt 1792403604871888367-3).
-
Connector/J 8.4.0 passed the committed 272-case JOIN/composition/SAMPLE probe. The supplemental TIME_WINDOW probe failed six query/mode combinations; all three ordinary GROUP BY controls passed. The combined JDBC check correctly exited 1.
-
Supplemental planner/packet validation reproduced seven failing TIME_WINDOW shapes with four passing controls. Descriptor compatibility and six existing golden-file audits passed.
-
At 32,765 plan nodes, the current-head extraction benchmark measured integer metadata at 1.58 microseconds/488 bytes, stored BOOLEAN at 11.32 milliseconds/20.05 MB, and computed BOOLEAN at 7.57 milliseconds/17.22 MB. These measure extraction cost, not SQL throughput or improvement over base.
Limitations:
-
No full Metabase replay, fresh whole-repository/race suite, mixed-version deployment or base/head SQL-throughput comparison was performed.
-
Supplied exact-head CI success statuses were reviewed; raw CI logs and local_validation gates were not supplied. The linked issue body was absent, so its behavioral contract was assessed from the frozen PR and discussion.
-
An initial audit dependency failure was resolved with a dependency-free audit. Its exit-1 receipt and recovered tool transcript are preserved separately from successful validation.
|
Addressed @XuPeng-SH's TIME_WINDOW P2 review in 821b9b2. The ordinal mismatch is fixed at the value-provenance owner: TIME_WINDOW now uses Regression coverage added:
Validation on the updated code (macOS arm64, Go 1.27.1, Connector/J 8.4.0):
Validation limits / non-passing control: the existing full |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 821b9b24bd0f15c62d2ed8ad2dd748834e949a0e
Assessment: approve
Reviewed the complete 40-file delta and supplied review concerns. The design correctly separates BOOLEAN value provenance from origin/key metadata, keeps classification local to result extraction, and reuses the authoritative TIME_WINDOW layout. No actionable defects remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
57 focused planner, frontend and compiler test roots passed at the frozen head, including TIME_WINDOW, recursive producers, SAMPLE routing, allocation bounds and retry metadata.
-
Connector/J 8.4.0 against a running frontend passed 96 TIME_WINDOW, 272 JOIN/composition and 144 MARK cases across statement, client-prepared and server-prepared modes. The separate WINDOW probe passed after correcting the reviewer's database setup.
-
Reconciled retained lifecycle race evidence against unchanged relevant inputs: seven focused roots, adaptive repetitions, and full objectio/txnbase race suites.
-
Audited generated protobuf descriptors, serialization, deep copy and all golden changes. Existing golden changes affect only computed BOOLEAN metadata; source remained unchanged.
-
Current 32,765-node extraction benchmark: integer metadata used 488 bytes and four allocations; BOOLEAN cases took approximately 10–11 ms and 17–20 MB.
-
Frozen-head CI reports successful Ubuntu UT/coverage, arm64 SCA and PROXY/PESSIMISTIC multi-CN BVT. Receipt, command, source, log and outcome reconciliation is retained in /home/xupeng/.local/state/mo-bot/jobs/7eb40621d8608805a36e1e4d/attempt-1/evidence-index.json; final-audit.log passed.
Limitations:
-
The initial JDBC command exited 1 because the reviewer selected protected mo_catalog for WINDOW setup. Its three other probes passed; only WINDOW was rerun after correcting setup.
-
Local JDBC validation used one CN and did not run Metabase itself. Raw CI logs were unavailable; reported unsuccessful author BVT runs were not counted as passes.
-
Benchmark measurements cover metadata extraction, not production throughput or a measured speedup against the merge-base. Darwin and rolling-compatibility CI were skipped.
|
Resolved the main-branch merge conflict in 0b71cd7 (main: The conflict was in the compressed Validation after merging:
|
|
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-xupeng · review
Commit: 0b71cd731402aace6e47c83e2b29baf486eb77ce
Assessment: request_changes
Complete delta reviewed. A confirmed RETURNING regression makes stored BOOLEAN metadata depend on the mutation expression.
Model: gpt-6-astra / xhigh
Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0
- P2
pkg/sql/plan/result_column_kind.go:297: With Connector/J tinyInt1isBit=true and t(id INT PRIMARY KEY, flag BOOLEAN), execute INSERT INTO t VALUES (1,TRUE) RETURNING flag or UPDATE t SET flag=FALSE RETURNING flag.
Impact: The stored column becomes TINYINT/java.lang.Integer, while SELECT, DELETE RETURNING and SET flag=flag RETURNING expose BIT/java.lang.Boolean. Preserve declared-column provenance across the RETURNING row-image boundary and add regression coverage.
Evidence: appendReturningProjection creates a target-row-image SINK_SCAN with TableDef, but this traversal follows its producer into the assignment literal and marks flag computed. Reproduced on both CNs: jdbc-runtime-final.log lines 2371–2379 and 3426–3434 show Integer results alongside Boolean controls. The base protocol always emitted BOOL width 1.
Validation:
-
Complete normal suites passed: pkg/pb/plan, pkg/sql/plan, pkg/frontend and pkg/sql/compile. Transaction-selector and resumed cleanup tests also passed.
-
Connector/J 8.4.0 passed 1,024 committed JOIN/SAMPLE, MARK and TIME_WINDOW cases, plus window probes, across two CNs. The separate RETURNING diagnostic reproduced the regression on both.
-
Source remained unchanged. Repository-owned native builds, source/native hash verification and git diff --check passed.
-
Receipts, logs and recovered setup/build failures are reconciled in /home/xupeng/.local/state/mo-bot/jobs/3a8de3cef7170ea0699054bd/attempt-1/validation-audit.json.
Limitations:
-
No race, full BVT or Metabase run; ancillary embedded shutdown, CDC and logtail scenarios were source-reviewed but not rerun.
-
local_validation was empty; linked issue text and exact-head CI logs were not supplied. Prior author and approval claims were not treated as passing validation.
|
Addressed @XuPeng-SH's RETURNING row-image P2 in 0908cf4. The value classifier now locates the dedicated target-row-image SINK_SCAN from the RETURNING step's unary input path, once per extraction. Column references stop at that declared row-image boundary instead of inheriting an INSERT/UPDATE assignment's computation. RETURNING expressions above the boundary remain computed. Other SINK_SCANs—including schema-bearing materialized producers in the same query—still follow their producers; this is not a blanket TableDef/SINK rule. The lookup is bounded and handles invalid roots, nil nodes and cycles without introducing a global cache or protobuf change. Added regressions:
Validation on the updated code (macOS arm64, Go 1.27.1, Connector/J 8.4.0):
CI status clarification: at intake, exact-head ALL CI run 39256950638 was already green, including Required CI, Ubuntu UT, arm64 SCA, coverage and both multi-CN BVT groups. No unrelated timeout/CI harness changes were needed. The push starts new-head CI; this comment does not claim its result yet. Local native tests linked existing CGo libraries; no fresh native-build, whole-repository, full Metabase, mixed-version or throughput certification 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: 0908cf44ae618591107b727309c27af5ea5946b5
Assessment: approve
Reviewed the complete 44-file delta, callers, ownership, failure paths, tests, documentation and frozen review concerns. No actionable findings remain. Planner-owned, extraction-local provenance correctly separates computed and stored BOOLEAN metadata. Shared operator layouts and the RETURNING target-image boundary avoid competing implementations; non-BOOLEAN results bypass graph construction.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Verified the frozen checkout remained clean and all 11,558 archived source files matched. Fresh native build and repository provenance verification passed; 196 native inputs and eight outputs were hash-checked.
-
Passed 74 root tests across protobuf, planner, frontend and compiler packages, including RETURNING, SAMPLE offsets, cyclic producer graphs, wire metadata and retry compatibility.
-
Passed real Connector/J 8.4 probes against the current-head server: 45 RETURNING, 272 JOIN/composed/SAMPLE, 144 MARK and 96 TIME_WINDOW cases, plus WINDOW checks. Verified text, client-prepared and server-prepared modes in the four counted probes.
-
Decoded protobuf descriptors confirmed only the additive enum and field 23. Existing golden-file changes preserve result rows and alter computed-BOOLEAN metadata headers only.
-
At 32,765 plan nodes, extraction measured 2.23 microseconds, 488 bytes and four allocations for integer output; BOOLEAN cases measured 12.0–13.7 milliseconds and 17.2–20.1 MB. The non-BOOLEAN allocation guard passed.
-
Reconciled seven retained race-check receipts and logs against unchanged lifecycle owners, test oracles, module and native inputs. These are explicitly older-head evidence, not fresh current-head executions. Frozen current-head CI also reports successful required checks.
-
Commands, source fingerprints, exits, log hashes and corrected audit-helper diagnostics are retained in /home/xupeng/.local/state/mo-bot/jobs/ada6a65fb1a88bed70d744e6/attempt-1/evidence-index.json. Final audit receipt 1792427744291116304-4.json exited successfully.
Limitations:
-
Local validation used one CN; no full Metabase replay, mixed-version deployment or throughput comparison was performed. Benchmark results are short extraction measurements.
-
The WINDOW probe permits prepared-statement fallback; verified server preparation is claimed only for the other four probes.
-
The standalone linked-issue body and raw CI logs were absent. Requirements were assessed from the frozen PR discussion. A missing prior-review artifact was explicitly excluded from reused evidence.
aunjgr
left a comment
There was a problem hiding this comment.
APPROVE at 0908cf44ae618591107b727309c27af5ea5946b5.
This is a metadata correctness repair, not a new SQL value/type system. Computed BOOLEAN results keep BOOL execution/row encoding but advertise numeric TINYINT width8; declared stored BOOLEAN columns retain width1. Value provenance is correctly separate from origin/key metadata, so recovering a computed result does not accidentally restore a source key or NOT NULL flag.
Traced the complete production change through result extraction, additive ColDef kind23 and deep-copy/serialization, frontend conversion and ColumnDefinition41 encoding. The extraction-local dependency graph distinguishes expressions, output slots and references; reverse propagation handles shared/recursive producers without caching a cycle as a false answer or mutating the plan. Lazy indexes preserve the existing identity/name routing, including Unicode EqualFold semantics, and non-BOOL results bypass this classification.
Checked JOIN input/output ownership and null-extension barriers, MARK's own marker versus a forwarded AGG slot, aggregate/SAMPLE offsets, left-only MINUS/INTERSECT value provenance, VALUES, value-preserving windows and LAG/LEAD defaults, TIME_WINDOW layout, and the dedicated RETURNING target-row-image boundary. The SAMPLE emitted-slot correction preserves the actual selected grouping value as well as its metadata.
Also reviewed the cumulative CI/lifecycle changes: commit-wait injection is narrowed to the intended transaction without changing disabled-fault behavior; cross-CN final reads wait for the writer's committed frontier after the race; cleanup uses independent bounded contexts and retains errors/resource-absence oracles rather than retrying unknown-result DDL or skipping assertions.
Validation: inspected planner/protocol regressions, additive descriptor tests and BVT metadata/value expectations; reused green exact-head CI, the author’s source-qualified normal/race checks, and reported real Connector/J Statement/client-prepared/verified server-prepared controls. Manual probe instructions alone were not treated as new execution receipts. No fresh local JDBC, full-suite race or throughput run is claimed. I found no remaining blocking issue.
Merge Queue Status
This pull request spent 6 hours 34 minutes 25 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Requeued — the merge queue status continues in this comment ↓. |
|
@mergify refresh |
✅ Pull request refreshed |
Merge Queue Status
This pull request spent 1 hour 6 minutes 8 seconds in the queue, including 1 hour 5 minutes 19 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #29952
What this PR does / why we need it:
Metabase sync-fields queries produce computed BOOLEAN results that Connector/J must expose as Number. Advertise these results with TINYINT width 8 while retaining BOOL value encoding. Stored BOOLEAN columns keep width 1 and Java Boolean metadata. The separate SHOW GRANTS parser issue was fixed by #29993.
Resolve value provenance through the existing JOIN routing owner, keeping origin/key barriers intact. An extraction-local dependency graph handles shared/recursive producers without repeated traversal or output-order-dependent false results. It follows the correct aggregate/SAMPLE offsets, set-operation ownership, MARK markers and window value/default arguments. Lazy projection/binding indexes avoid repeated wide-JOIN scans; immutable reference keys reduce graph storage without a global cache or plan mutation. Non-BOOL outputs bypass classification.
Validation on the rebased source includes normal/race metadata and affected lifecycle tests, incremental SCA across the complete 11-package delivery closure, and real Connector/J 8.4.0 execution: 222 JOIN/composed cases, 144 MARK cases and the window probe, covering Statement, client-prepared and verified server-prepared execution.
Identical real-binder shared/recursive probes preserve result kinds and node counts. Compact keys reduce allocated bytes at the larger sizes from 32.9 to 20.1 MB (stored BOOL), 28.4 to 17.2 MB (computed BOOL), and 155.4 to 95.7 MB (recursive). These are metadata-extraction TotalAlloc measurements, not peak memory or SQL throughput. Full CI and TP throughput are not claimed.