Skip to content

fix(external): keep parquet scalar siblings vectorized - #29285

Merged
XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
daviszhen:codex/fix-29229
Sep 23, 2026
Merged

XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
daviszhen:codex/fix-29229

Conversation

@daviszhen

@daviszhen daviszhen commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

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

Which issue(s) this PR fixes:

Related to #29229. The production 100M-row TKE acceptance run remains a deployment-level validation item; this PR is scoped to the hybrid Parquet conversion fix and its reproducible benchmark.

What this PR does / why we need it:

Keep Parquet LIST/vector columns on the row reader so values spanning data pages are reconstructed correctly, while projecting only nested columns into that reader. Scalar sibling columns continue through the page-vectorized mappers, avoiding wide-schema row-mode conversion and the associated LOAD DATA amplification.

The regression coverage includes mixed nested/scalar projections, multiple row groups, byte-budget rollback, and a true 31-column benchmark with two Parquet LIST-to-vector columns plus 29 scalar siblings. The benchmark compares the hybrid path with the pre-hybrid all-row path and records wall time, allocations, page/row-mode time, bounded ReaderAt Range calls/bytes, row-group count, and peak batch/read-ahead cache bytes.

Validation

  • go test ./pkg/sql/colexec/external -count=1
  • CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" CGO_LDFLAGS="-L$(pwd)/thirdparties/install/lib" go test ./pkg/sql/colexec/external -run '^$' -bench '^BenchmarkParquetWideMixedNestedProjection$' -benchmem -benchtime=5x

Preserve the LIST row reader for nested vector reconstruction while decoding scalar sibling columns through page mappers. Add mixed projection and multi-row-group regression coverage for matrixorigin#29229.
@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 →

@daviszhen

Copy link
Copy Markdown
Contributor Author

Follow-up for the exact-head review (9955f26):

  • Added TestParquetWideMixedNestedProjectionUsesHybrid, asserting that a 31-column projection keeps both LIST-to-vector columns on the projected row reader and all 29 scalar siblings on page mappers.
  • Added BenchmarkParquetWideMixedNestedProjection. It writes 8 row groups of 4096 rows with two real Parquet LIST columns (vecf32(3), vecf64(3)) plus 29 scalar siblings, and uses the bounded parquetRangeReadAheadReaderAt over a counting ReaderAt.

On the local Apple M5, -benchtime=5x -benchmem produced:

path ns/op B/op allocs/op range calls/op fetched bytes/op page columns/op
hybrid 6,718,050 22,704,801 146,785 91 1,287,466 29
all row mode 15,452,008 42,287,145 269,836 227 2,999,322 0

Both paths read 4096 rows across 8 row groups; the hybrid path reports 2 nested columns, 4,159,301 ns page-map time, 6,217,825 ns row-mode time, 290,816-byte peak batch, and 27,560-byte read-ahead cache. This directly exercises the path that the existing BYTE_ARRAY/STRING 100M fixture does not exercise.

The PR description is now scoped to the reproducible hybrid conversion fix (Related to #29229); the 3-CN remote 100M TKE acceptance run remains a deployment-level validation item rather than an unverified claim from this local benchmark. Existing STRING-fixture A/B results remain documented in #29229.

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

GPT-6 High deep review of exact head 9955f26e65c65808d71253ccabf4bb00cc6c8eea: APPROVE.

I found no blocking correctness, cleanup, or scoped performance-evidence issue. The hybrid path keeps only the projected LIST/vector columns on the row reader, preserves scalar leaf/page mappings, and synchronizes accepted row counts and byte-budget rollback/seek positions. I traced EOF, null/empty and malformed pages, conversion errors, cancellation, partial batches, and reader cleanup through the external scan/reset path.

The added benchmark exercises two real LIST-to-vector columns plus 29 scalar siblings against an all-row-mode control. Reported results show 6.718 ms vs 15.452 ms, 22.7 MB vs 42.3 MB allocated, and 91 vs 227 range-read calls per operation. These are local synthetic ReaderAt results, not remote S3/CN fanout or deployment peak-memory evidence. The PR has explicitly narrowed its scope; the three-CN 100M-row deployment acceptance remains a separate validation item, not a claim this change has conclusively fixed.

Exact-head CI (including UT, race, SCA and BVT) passed; reviewed the BVT execution records (Parquet LOAD 196/196, cross-type 14/14, dictionary 22/22; zero ignored).

@mergify mergify Bot added the queued label Sep 23, 2026
@mergify

mergify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-23 20:05 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-23 20:14 UTC · at 7312029bacbd839166442925899e90ad0842a261

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

Reason

The pull request can't be updated
> This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable ["Allow edits from maintainers"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

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

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
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/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants