Skip to content

fix: load parquet vectors across data pages - #29111

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
daviszhen:codex/issue-29110-parquet-vector
Sep 19, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
daviszhen:codex/issue-29110-parquet-vector

Conversation

@daviszhen

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:

issue #29110

What this PR does / why we need it:

Parquet V1 data pages may split one repeated LIST row across physical pages. The
page-local vector mapper treated the trailing fragment as a complete vector, so
a valid LIST<DOUBLE>[1536] could be rejected as a 512-dimensional vector.

This change routes supported LIST-to-vector mappings through parquet-go's
projected logical-row reader, then reuses the existing typed LIST conversion for
dimension, NULL, overflow, and rollback semantics. When row mode is selected,
sibling scalar columns retain their existing page-mapper conversions. It also
preserves whole-row rollback, ColDef.NotNull, malformed LIST validation,
cancellation, byte-budget batching, and reader cleanup.

Validation:

  • Added a compact PyArrow 12 V1 fixture whose first vector crosses a page with
    NumRows()==0; verified every ID and every vector element across small-budget
    batches.
  • Covered all supported vector element families, sibling DECIMAL/DATE/JSON and
    string conversions, NULL constraints, malformed NULL/missing LIST rows,
    cancellation, and whole-row rollback.
  • go test ./pkg/sql/colexec/external -count=1
  • make build
  • Ran the issue's original SQL against the supplied 449,785,510-byte file:
    50,000 rows loaded, with MIN/MAX(vector_dims(emb)) = 1536/1536.

The logical-row path is less vectorized and has higher allocation volume than
the page path; one unusually large logical row remains bounded only by the
Parquet decoder. The observed full-file LOAD completed in about 3.6 seconds on
the validation host.

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

Astra medium review on exact head 8e77723.

[P2] LIST 切换到 row mode 后,BOOLEAN sibling 无法转换为 FLOAT/DOUBLE。

位置:pkg/sql/colexec/external/parquet_nested.go:304-316。

触发条件:Parquet 同时包含合法 LIST 向量列和非 NULL BOOLEAN 列,目标分别为 vecf32(2) 和 FLOAT 或 DOUBLE,例如 emb=[1,2], flag=true;不需要跨页即可触发。

本 PR 为 LIST 投影启用 row mode。canAppendParquetRowLeafDirectly 将 BOOLEAN -> float32/float64 判为可直接转换,绕过已有 page mapper;appendLeafValue 最终调用 parquetValueToFloat64,而该 helper 没有 BOOLEAN 分支,确定返回 cannot convert parquet BOOLEAN to floating point。原 page mapper 明确支持 BOOLEAN -> float32/float64,并将 true/false 转为 1/0。因此这是已有可加载文件在引入 LIST row mode 后的回归。

请将 BOOLEAN -> 浮点排除在 direct 分支之外并复用已有 mapper,或为共享转换 helper 补齐等价 BOOLEAN 语义;同时增加 ParquetReader 回归,覆盖 LIST + BOOLEAN sibling、FLOAT/DOUBLE 两种目标以及 true/false。

其余 V1 logical-row 重建、LIST 校验、整行 rollback、byte-budget 和 reader cleanup 路径未发现额外 P0/P1/P2。exact-head CI 已通过,coverage 不作为门槛。本次 finding 由源码调用链确认,未本地复现。

@daviszhen

Copy link
Copy Markdown
Contributor Author

Addressed the BOOLEAN sibling row-mode regression in bec9b29. parquetValueToFloat64 now preserves the existing page-mapper semantics (true -> 1, false -> 0), so both FLOAT and DOUBLE direct row-mode conversions work. The ParquetReader LIST sibling regression now covers both target types and both boolean values.\n\nValidation:\n- reproduced the reported failure before the production fix\n- go test ./pkg/sql/colexec/external -run '^TestParquetListVectorRowModePreservesSiblingMappers$' -count=1\n- go test ./pkg/sql/colexec/external -run '^TestParquetListVector' -count=1\n- go test ./pkg/sql/colexec/external -count=1

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

Astra medium re-review on exact head bec9b29.

此前 P2 已修复:BOOLEAN -> FLOAT/DOUBLE 仍可走 row-mode direct branch,但 parquetValueToFloat64 现在正确处理 true -> 1、false -> 0;FLOAT 通过同一 helper,语义与原 page mapper 等价。真实 ParquetReader.Open/ReadBatch 回归同时覆盖 LIST vector、FLOAT/DOUBLE sibling 和 true/false。

重新核对了 V1 跨页 logical-row reconstruction(含 NumRows()==0 continuation page)、维度/NULL/malformed/overflow、sibling scalar、整行 rollback、byte budget、reader cleanup、Reset/Free 和取消路径,未发现新的 P0/P1/P2 缺陷。

验证边界:decoder 对单个巨大逻辑行的瞬时内存和解码中途取消仍没有硬上限/即时中断保证;本次未独立重跑超大行或原始大文件 SQL。这些是已披露的验证边界,不是 material defect。exact-head CI 的 external race、build、SCA 和相关 BVT 已通过。

APPROVE。

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

mergify Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-19 16:10 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-19 16:15 UTC · at 1721cbc6551ab7799f45ec8ec2d0a1766846e606

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

Reason

Pull request #29111 has been merged manually at bde7e0c

Hint

You were too fast!

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 bde7e0c into matrixorigin:main Sep 19, 2026
19 of 21 checks passed
@mergify mergify Bot removed the queued label Sep 19, 2026

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