Skip to content

fix external JSONLINE nulls in parallel load - #29773

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-29768-jsonline-null
Oct 9, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-29768-jsonline-null

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

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 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 b6fa8ccfc729105a31f61dbed0c97d7f21a2b86e 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.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mergify mergify Bot added the queued label Oct 9, 2026
@mergify

mergify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-09 11:56 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-10-09 12:10 UTC · at 3984a38bf704c851ed73b734b6cb35cbcae37649

This pull request spent 14 minutes 22 seconds in the queue, with no time running CI.

Reason

Pull 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.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You 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.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 5171a0c into matrixorigin:main Oct 9, 2026
@mergify mergify Bot added dequeued and removed queued labels Oct 9, 2026
XuPeng-SH pushed a commit that referenced this pull request Nov 25, 2026
## 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>
@VioletQwQ-0
VioletQwQ-0 deleted the codex/issue-29768-jsonline-null branch December 1, 2026 03:47

This branch was previously deployed

1 inactive deployment
ci — 3984a38b Deployed Oct 9, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants