Repository navigation
[4.2-dev] fix external JSONLINE nulls in parallel load - #33210
Conversation
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#29768 The issue remains open for QA; this PR does not auto-close it. ## What this PR does / why we need it: Parallel `LOAD DATA` JSONLINE currently converts an explicit JSON `null` into numeric and boolean zero values because the empty-field zero-fill branch ignores the field's null marker. Preserve `Field.IsNull` so nullable INT, DECIMAL, and BOOL columns keep SQL `NULL` for both JSONLINE object and array input. ## Root cause and scope `transJsonObject2Lines` and `transJsonArray2Lines` already emit `csvparser.Field{IsNull: true}` for JSON `null`. The shared parallel LOAD DATA consumer now applies the empty numeric zero-fill rule only when `Field.IsNull` is false. Ordinary empty CSV numeric fields continue to use the existing zero-fill behavior, and CSV `\\N` remains `NULL`. ## Validation - Exact base `b6fa8ccfc729105a31f61dbed0c97d7f21a2b86e` build: PASS. - Focused external UTs for empty numeric, JSONLINE object/array producer-to-consumer nulls, typed zero, and `\\N`: PASS. - Full owning package `./pkg/sql/colexec/external` via the repository CGo wrapper: PASS. - Incremental `go list`, `go vet`, and `golangci-lint --new-from-rev b6fa8cc` with repository CGo flags: PASS. - Canonical SQL/BVT `test/distributed/cases/load_data/issue_29768_jsonline_null.sql`: PASS 20/20 twice (serial and explicit parallel object/array JSONLINE; INT, DECIMAL(39,10), BOOL; non-null and explicit-null rows; teardown). The reviewed PR base is `c2c1031d0ba4b1034849f6bd3d267252a11eb6c9`; its one-commit delta from the tested base does not touch the affected package or LOAD DATA JSONLINE fixtures. No implementation dependency or merge-order prerequisite is required. ## QA decision QA required: yes. Automated tests cover object/array JSONLINE null materialization and stored INT, DECIMAL, and BOOL values, with two normal BVT comparison runs and teardown. The small SQL fixtures exercise the requested-parallel policy and may fall back below parallel admission; they do not establish physically admitted multi-worker SQL execution. That deployment scenario remains QA work. Ready indicates maintainer review; CI, deployed QA, and merge remain pending. No QA handoff is sent by this update. ## Partial scope This change covers nullable scalar INT, DECIMAL, and BOOL values supplied as explicit JSON `null` through JSONLINE object and array records in parallel LOAD DATA. It leaves unrelated formats, non-null empty-field compatibility behavior, and issue closure to their existing paths. ## Final head binding Reviewed exact PR head: `3a1a64c56abd641a07a418af148fc95380139873`, a Mergify merge of `main` `c2c1031d0ba4b1034849f6bd3d267252a11eb6c9` into implementation commit `b57b3896348448324dfa1329b84145445c2700b0`; the merge has no changes under the affected external LOAD DATA or issue 29768 fixture paths. - Exact-head focused command selected and passed all four named controls with `-v -count=1`: `TestGetColDataParallelLoadEmptyNumericAndJSONNull`, `TestJSONLineNullRemainsNullWithParallelLoad` (object/array), `TestGetColDataParallelLoadEmptyNumericAsTypedZero`, and `TestGetColDataParallelLoadNullNumericRemainsNull`. - Exact-head owning-package command `mo-cgo-test -count=1 -timeout=120s ./pkg/sql/colexec/external`: PASS. - Independent Astra A/B semantic preflight is complete with `PASS_NO_BLOCKING_FINDING`; its report is bound to the same head/base. CI, deployed QA, merge, and issue closure remain external follow-up. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 5171a0c)
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: 6581d0e5b9403d50de15cd8346ad27cd11a860c3
Assessment: approve
The shared external conversion owner now preserves explicit JSON null markers before applying the existing empty-numeric-to-zero policy and propagates null-append allocation errors. The existing owner handles the distinction without new state or a parallel conversion path. The committed small-file SQL cases exercise the requested parallel setting; an additional branch-specific large-file probe confirmed actual two-range execution and correct stored values.
Model: gpt-6.1-terra / max
Session: 01a211d7-e427-70e2-a993-c62f1960cb9e · slot 3 · generation 3
Validation:
-
Private /tmp and loopback preflight passed on the assessed head: preflight.log and checks/1795601513698833523-3.json.
-
The complete external owning package passed on the assessed head with 1,078 named tests/subtests and no skips: owning-package-tests.log and checks/1795602126476643931-5.json. The separate focused run covered JSON object/array nulls, empty and missing numeric fields, and allocation failures: focused-tests.log and checks/1795601725350204034-3.json.
-
A reviewer-only Go overlay exercised the MySQL TCP frontend of a one-CN embedded cluster with serial and STRICT false parallel LOAD for object and array JSONLINE files of approximately 289 MB each. Each load checked every INT, DECIMAL(38,10), BOOL and null marker for 24,000 rows (3,428 null rows, zero mismatches); server logs record mcpu=2 and two distinct file ranges in each parallel load. The test passed: review_json_null_integration_test.go, review-overlay.json, integration-tests.log and checks/1795602016855442153-5.json.
-
Native build inputs and retained library checksums matched the assessed source before reuse: native-reuse.log and checks/1795601525844056895-3.json.
Limitations:
-
The committed two-row SQL fixtures fall below the 128 MiB parallel-read threshold, so their parallel-requested cases use the small-file fallback; real two-range execution was verified by the reviewer-only probe.
-
The large-file probe used one CN and direct local files; it did not repeat the linked issue’s multi-file or multi-CN scenarios. The linked issue’s reported multi-file validation was on main, not this 4.2 branch.
🚫 Left the queue · pull request dequeued1 h 9 min in the queue, with no time running CI. So far
Reason Pull request #33210 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.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
|
@Ariznawlll 请协助验收包含合并提交
请在本 PR 回填实际构建提交、环境、两种格式的预期和实际 NULL 行数、差异及历史数据核对结果。 |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29768. Cherry-picks #29773 onto
4.2-dev.What this PR does / why we need it:
Parallel JSONLINE LOAD DATA must preserve explicit JSON nulls as SQL NULL for numeric and Boolean columns. Respect the field null marker before applying the existing empty CSV numeric zero-fill rule.
Base
bb197e5118507d830f5e50f99a2676bb88a8d62f, current head051489b1608be825421f9b7bc15b5721b6fcb311. The producer-to-consumer test failed with the old production file and passed with the cherry-pick. The external package passed on the initial release base, and focused external UT passed on the current release production content.git diff --checkpassed.BVT:
test/distributed/cases/load_data/issue_29768_jsonline_null.sqlpassed 20/20 against standalone binary028e094f1a57e6ffb8913651f5bc85bfed5310b7, with no failed or ignored statements. The first attempt exposed unsupported DECIMAL256 in the 4.2 JSONLINE loader. The current SQL and result fixtures use DECIMAL(38,10) and assert the exact imported values for serial and parallel object/array input. Those two fixtures are the only changes since the running binary and were used for the passing run.QA required: yes. Re-run with the affected import configuration and verify previously imported data separately.