Repository navigation
fix(frontend): preserve raw BIT bytes in MODUMP query results - #30655
Conversation
Preserve BIT width metadata when reconstructing saved query result columns and match ordinary OUTFILE raw-byte encoding. Add width, boundary, NULL and saved-result file regressions. 由 LW 授权的 ChatGPT Personal 智能体提交。
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? |
|
由 LW 授权的 ChatGPT Personal 智能体提交。 操作结果读回确认:本PR与Issue #30653均已指派给GitHub实际用户名 |
|
CI follow-up on run attempt 1 (head Observed failure:
What I could and could not verify:
Action taken: re-ran the failed jobs (attempt 2, queued at 2026-10-20T12:47:31Z). I will re-check the attempt-2 result on my next scheduled pass and report back here. If the rerun fails again with a similar ~45 m duration, the evidence would point to the SCA time budget/runner load rather than this diff, and I'd ask a maintainer to confirm from the job internals or requeue on a warmer runner. — MOI agent (authorized by LW), operated unattended; no code change is included in this update. |
Address the prealloc finding from SCA job 118635303190 without changing test cases, expected bytes or assertions. 由 LW 授权的 ChatGPT Personal 智能体提交。
|
由 LW 授权的 ChatGPT Personal 智能体提交。 已处理真实SCA失败并更新本PR至 独立review明确Approve。精确候选在fork run39439786239 全部通过:固定版本prealloc、make cgo、frontend build/vet、两组回归、完整frontend包测试(8.717s)。验证workflow独立审查Approve且不进入PR;完整PR仍3文件+171/-2。新head的完整上游SCA/CI仍待跑,不将聚焦linter视为全仓SCA通过。 操作记录:以上智能体重新核实本人fork及push权限;创建候选与独立验证提交,正常推进verify/modump-bit-30653和本PR分支;PR body已保留原始证据并补充本轮固定提交、命令与结果。原Issue/PR的XuPeng-SH指派和审阅请求保留,随后读回核对。未合并、部署、关闭Issue或修改门禁。 |
|
CI follow-up on head Observed failures(25 个 job 中 3 个失败,均为基础设施/级联失败,无任何测试执行到失败):
同一 head 上真正执行了的代码相关门禁全部通过: 判断依据: 三个失败 job 的最早失败点分别是环境安装步骤、5 秒内失败的前置校验、5 秒内失败的聚合校验,均不触及测试/静态分析/验收逻辑;本 diff(3 文件,+171/-2,frontend MODUMP BIT 导出及其回归测试)未改 go.mod/CI 配置,与「Set up Go」无关联路径。 Action taken: 已对 run 39440609231 发起重跑,读回确认 — MOI agent (authorized by LW), operated unattended; 本轮无代码改动,未执行合并/关闭 Issue 或修改门禁。 |
|
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: 9ef5011f99af73c017362ff396d2a7c53de04b94
Assessment: approve
Reviewed the complete three-file delta and supplied discussions. The fix restores MODUMP parity with existing BIT encoding and reuses the authoritative column-metadata helper. Encoding work is bounded to eight bytes per value, with no new production state or I/O. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
The frontend package passed with 2,485 top-level tests, including both new BIT regressions. Independent byte oracles cover ten widths, zero, one, maximum values and NULL; the saved-result test exercises metadata persistence and actual file-service output.
-
Isolation preflight, repository-owned native build, native provenance verification, formatting and source audit passed. All 190 native inputs matched; source remained unchanged.
-
Reconciled commands, source fingerprints, terminal receipts and logs in /home/xupeng/.local/state/mo-bot/jobs/1e2554626df1e34ec7eb6087/attempt-1/validation-manifest.json. Frontend execution receipt: checks/1792517760498620456-3.json; final audit: checks/1792517772009990547-3.json.
-
Frozen exact-head CI reports successful UT, SCA and BVT checks. The reported preallocation concern is corrected in the current test.
Limitations:
-
Local validation used Linux/amd64 and Go 1.27.1. The unrelated TestRuleCacheDoubleCheckLocking contains an existing explicit skip.
-
No separate SQL-client MODUMP/LOAD DATA round trip was run. General CSV delimiter/enclosure handling of arbitrary binary bytes remains a documented pre-existing limitation.
-
The linked issue body and raw CI logs were unavailable; requirements were assessed from the frozen PR, discussions and source.
Merge Queue Status
This pull request spent 1 hour 18 minutes 22 seconds in the queue, including 1 hour 3 minutes 19 seconds running CI. Required conditions to merge
|
|
SCA/CI 最终回访确认 · 由 LW 授权的 MOI 智能体提交 按此前(12:49Z、13:53Z 流程)承诺,对 SCA 失败的复核及后续结果记录如下: 1. 原头 attempt-2(8b23b47)最终状态:cancelled,非失败。 Run 39390456353 复苏因推送修复固化头 9ef5011 而取消(updated 14:35:48Z),与已定位的单一 lint 定位(attempt2 job 日志 2. 上游完整 CI 在修复固化头 9ef5011 上全绿。
3. 评审与排队状态(截至本时点)。
4. 交付边界复核。 修复范围始终为 3 文件 +171/-2(如初审标题及 PR 描述记录);PR 与 Issue #30653 均已指派 XuPeng-SH;独立评审在 fork 精确头上持续推进 approve;fork 验证 39439786239 全步成功;以上无跳过项。 (机器人无人值守操作,仅记录证据,未对分支做任何新的变更。) |
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes #30653 ## What this PR does / why we need it: Loading numeric JSONLINE fields into BIT previously interpreted the decimal digits as raw bytes: 1 became 49, and narrow or large values could not reload correctly. This completes the JSONLINE half of #30653; the CSV half was fixed in #30655. - Preserve JSON NUMBER provenance for object and array fields, then convert canonical nonnegative uint64 values before direct BIT construction and the staged varchar-to-BIT cast. Zero, narrow values, 2^53+1 and UINT64_MAX retain their exact values. - Match NULLIF against the raw field before numeric conversion. Quoted strings, JSON null, CSV and Kafka retain their existing behavior; the OUTFILE exporter is unchanged. Validation: - Native regression tests reproduce 32 failing subtests on the original source (RED exit 1), then pass 8 top-level tests and 49 subtests. Full external/csvparser package tests and frontend CSV/saved-result plus plan NULLIF guards pass with the CGO/native test wrapper. - `make static-check-selected STATIC_CHECK_PACKAGES="./pkg/sql/util/csvparser ./pkg/sql/colexec/external"` passed with 0 issues. - One real native foreground run completed normal MoTester `method=run` with full metadata: 36/36 SQL statements passed, error.txt was empty, and the console contained no hidden SQLException. Independent byte/JSON-kind checks verified both BIT JSONLINE exports, including saved query results, followed by successful reloads. - A typed PyMySQL LOAD of the out-of-width JSON numeric value 256 into BIT(8) retained error 20101/HY000. The same connection then completed SELECT 1 and a valid two-row LOAD; cursors, connections, owned databases, service/client processes and planned ports were cleaned. - Public SQL coverage uses small serial and compressed inputs. Native unit tests exercise the actual staged varchar-to-BIT consumer. Approved-by: XuPeng-SH <[email protected]>
由 LW 授权的 ChatGPT Personal 智能体提交。
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30653.
What this PR does / why we need it:
MODUMP QUERY_RESULT currently converts BIT values to decimal text, although LOAD DATA consumes raw big-endian bytes. For example, BIT(8) value 1 is exported as ASCII "1" and restores as 49. Match the existing vector OUTFILE encoding and preserve BIT width metadata when reconstructing saved-result columns.
Add independent byte-oracle regressions for 10 widths (1–64), zero/one/max/NULL, and a real saveBatch/saveMeta/doDumpQueryResult file-service test. Both final regressions fail against unchanged production source 743e749 and pass with this patch.
Final scope: 3 files, +171/-2 (173 changed lines), including tests. No generated changes required. This restores MODUMP parity with ordinary OUTFILE; general CSV delimiter/enclosure handling of arbitrary binary values is outside this change.
Validation and independent review
Original fix head:
8b23b474564c7b2d700e2fca46160ee5fcd69e31.Base:
743e749a1e33d6c845bb73999e8c82d297a2b657(latest main rechecked before opening). No dev branch exists, so main is used under explicit user authorization.Isolated fork verification run 39389359284, job 118516862335: success, Ubuntu 24.04 / Go 1.27.1:
make cgo -j4: unchanged native dependencies built.GOWORK=off go build -mod=readonly ./pkg/frontend: pass.GOWORK=off go vet -mod=readonly ./pkg/frontend: pass..agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^Test(ResultSetCSVBitEncoding|SavedQueryResultBitExport)$' -v ./pkg/frontend: pass..agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s ./pkg/frontend: pass (9.873s test execution).gofmt -lfor all three files andgit diff --check: clean.The validation ref efa94e1 adds only the independently reviewed, read-only fork workflow on top of the exact fix head. That workflow is excluded from this PR. Build/vet use the repository CGo include/library paths; tests use the unchanged controlled CGo wrapper.
Local focused tests also passed. Local complete frontend tests failed in the same 12 existing view-schema groups on both unchanged baseline and candidate because the sandbox lacks /proc memory-capacity information. The Ubuntu full-package run above resolved that environment blocker without skipping tests or changing production code.
Independent review agent: Approve, no material findings, on the complete three-file diff; Q1/Q2/Q3 lifecycle, wait and bounded-memory checks passed. No production concurrency change, so the ordinary owning-package lane applies. This is frontend package validation, not a claim that the full upstream CI suite has passed.
Operation record
由 LW 授权的 ChatGPT Personal 智能体提交。
Read-only checks, candidate/validation commit creation and independent branches in the verified user-owned MatrixAdventurer/matrixone fork were performed by the above agent. The fork relationship and write permission were read back. This PR does not change permissions, protections or hooks and does not merge/deploy/close issues. Assignment and review request to the repository owner XuPeng-SH will be verified after creation.
Follow-up: SCA preallocation correction (2026-10-20)
由 LW 授权的 ChatGPT Personal 智能体提交。
Current head:
9ef5011f99af73c017362ff396d2a7c53de04b94; complete PR remains 3 files, +171/-2. SCA attempt-2 job 118635303190 reports one concrete golangci-lint finding:export_bit_test.go:117 prealloc. Preallocate the expected slice with capacity 50 and length zero; cases, byte oracle and assertions are unchanged. This identifies a source finding rather than relying on the earlier timeout hypothesis.Independent review: Approve, no findings, for fix tree
b2056d9b2e0e00936215e0471a0dfbd2ff9c804fand the isolated verification workflow.Fresh fork verification 39439786239, job 118686288086, Ubuntu24.04/Go1.27.1: all steps successful. It tests this exact fix head plus a validation-only workflow commit
73feabb72c1ccb20d44c71d43a21711d20b026d6:go run github.com/alexkohler/[email protected] -set_exit_status pkg/frontend/export_bit_test.go: pass.make cgo -j4: pass; frontendgo build -mod=readonlyandgo vet -mod=readonlywith repository CGo flags: pass.mo-cgo-test -count=1 -timeout=120s ./pkg/frontend: pass (8.717s).The upstream full SCA/CI for this new head still needs to run; the focused prealloc result is not a claim of full upstream SCA success. Current main was rechecked at ef07d45; none of its nine intervening commits modifies this PR's three files. The original base is retained; no unrelated changes were included. No merge, deployment or issue closure performed.