Repository navigation
fix external JSONLINE nulls in parallel load - #29773
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review at 3a1a64c56abd641a07a418af148fc95380139873, merge-base c2c1031d0ba4b1034849f6bd3d267252a11eb6c9: no blocking finding; approve.
Read all seven changed files and issue #29768. The fix belongs in the existing shared getColData materialization owner: the JSON object/array producers already carry explicit null as Field.IsNull, and zero-fill must not override that fact. The new guard closes both VARCHAR staging and direct typed-vector paths without adding format branches, state, storage, or a second conversion implementation. Non-LOAD readers and serial controls retain their existing policy.
Adversarial controls: explicit null with empty payload versus an ordinary empty numeric field; CSV \N and NullMap versus real zero; JSON object versus array; staging versus typed vectors. Traced NULL append errors through materializeOneRow/getOneRowData, including the existing rollback/error path. No new waits/resources or accumulation. Cost is one short-circuit boolean check on empty fields, with no new allocation or I/O.
Increment assessed separately: production +1/-1; tests/fixtures +108/-3; documentation 0. Tests reuse the existing conversion fixture and real JSON producer, while BVT checks stored INT/DECIMAL256/BOOL values and NULLs with serial/parallel policy controls and cleanup. Reused exact-head four named focused tests and full external-package PASS, plus semantically unchanged 20/20 BVT comparisons twice. As explicitly documented, these small BVT files do not prove physical multi-worker admission; no scheduling behavior changes here. Latest exact-head CI Required succeeded in run 37905418082 (the older failed run is superseded). No previous inline/review findings were present, and no additional broad rerun is claimed.
Merge Queue Status
This pull request spent 14 minutes 22 seconds in the queue, with no time running CI. ReasonPull request #29773 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? - [x] BUG - [x] Test and CI ## 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 head `051489b1608be825421f9b7bc15b5721b6fcb311`. 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 --check` passed. BVT: `test/distributed/cases/load_data/issue_29768_jsonline_null.sql` passed 20/20 against standalone binary `028e094f1a57e6ffb8913651f5bc85bfed5310b7`, 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. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #29768
The issue remains open for QA; this PR does not auto-close it.
What this PR does / why we need it:
Parallel
LOAD DATAJSONLINE currently converts an explicit JSONnullinto numeric and boolean zero values because the empty-field zero-fill branch ignores the field's null marker. PreserveField.IsNullso nullable INT, DECIMAL, and BOOL columns keep SQLNULLfor both JSONLINE object and array input.Root cause and scope
transJsonObject2LinesandtransJsonArray2Linesalready emitcsvparser.Field{IsNull: true}for JSONnull. The shared parallel LOAD DATA consumer now applies the empty numeric zero-fill rule only whenField.IsNullis false. Ordinary empty CSV numeric fields continue to use the existing zero-fill behavior, and CSV\\NremainsNULL.Validation
b6fa8ccfc729105a31f61dbed0c97d7f21a2b86ebuild: PASS.\\N: PASS../pkg/sql/colexec/externalvia the repository CGo wrapper: PASS.go list,go vet, andgolangci-lint --new-from-rev b6fa8ccfc729105a31f61dbed0c97d7f21a2b86ewith repository CGo flags: PASS.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
nullthrough 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 ofmainc2c1031d0ba4b1034849f6bd3d267252a11eb6c9into implementation commitb57b3896348448324dfa1329b84145445c2700b0; the merge has no changes under the affected external LOAD DATA or issue 29768 fixture paths.-v -count=1:TestGetColDataParallelLoadEmptyNumericAndJSONNull,TestJSONLineNullRemainsNullWithParallelLoad(object/array),TestGetColDataParallelLoadEmptyNumericAsTypedZero, andTestGetColDataParallelLoadNullNumericRemainsNull.mo-cgo-test -count=1 -timeout=120s ./pkg/sql/colexec/external: PASS.PASS_NO_BLOCKING_FINDING; its report is bound to the same head/base. CI, deployed QA, merge, and issue closure remain external follow-up.