Skip to content

fix(external): reject NaN/Inf vector elements in Parquet LIST loads - #31831

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix-31508-parquet-vector-finite
Oct 30, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix-31508-parquet-vector-finite

Conversation

@MatrixAdventurer

@MatrixAdventurer MatrixAdventurer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Fixes #31508

What this PR does / why we need it:

LOAD DATA ... format 'parquet' into a vector column took LIST<FLOAT/DOUBLE> elements without the vector NaN/Inf check: VECF32/VECF64 stored NaN and ±Inf, and VECF16/VECBF16 narrowed out-of-range finite values (e.g. 100000 → f16, 3.4e38 → bf16) to +Inf. The same values through SQL (insert ... '[NaN,1]') fail with vector element cannot be NaN or Inf.

Cause: the element converters in getNestedListMapper (parquet.go) only converted the value; nothing checked the result is finite.

Fix (parquet.go +31/-11): new helper parquetVectorElemFinite with the same error text as types/array_str.go. Every float vector converter calls it; F16/BF16 check the narrowed value, so overflow to Inf is caught as in the SQL path. The existing DOUBLE → FLOAT overflow error is kept.

Tests

  • New UT parquet_list_vector_finite_test.go: 12 NaN/Inf/overflow cases across VECF32/F64/BF16/F16 rejected (RED on main, all 12 fail), finite values still load. go test ./pkg/sql/colexec/external/ passes.
  • New BVT load_data/parquet_vector_nonfinite.sql with 5 small Parquet files built with PyArrow, as in the issue: main 14/24 (the 4 loads succeed and store the rows), PR 24/24.
  • BVT dir load_data: PR 1705/1710 passed, 5 ignored, 0 failed.

Merge Danger

Low. Parquet loads that contain NaN/Inf (or values outside the F16/BF16 range) into vector columns now fail with the SQL path's error instead of storing those values. Finite data is unchanged.

本操作由 LW 授权的 Grok Bot 智能体执行。

Parquet LIST<FLOAT/DOUBLE> -> VECF32/VECF64 accepted NaN and Inf, and
VECF16/VECBF16 silently narrowed out-of-range finite values to +Inf,
while the SQL input path rejects both. Check every element (after
narrowing) with the same "vector element cannot be NaN or Inf" error.

Fixes matrixorigin#31508
@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 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 77bf276b4322c962ec7877371589c25867069c3a

Review completed. Read the assessment.

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

mo-bot review · mo-bot-local · review

Commit: 77bf276b4322c962ec7877371589c25867069c3a

Assessment: approve

The fix rejects non-finite vector elements after conversion, including narrowing overflow, while preserving finite values and existing rollback paths. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • All 11 focused tests passed, including 12 new rejection cases and finite-value controls.

  • Owning external-package tests passed; changed Go files are gofmt-clean.

  • Independently decoded and verified all five Parquet fixtures.

  • Reused frozen exact-head CI evidence. Receipts and logs reconciled in validation-evidence.json; source unchanged and discussion assessment complete.

Limitations:

  • No local service BVT run; individual CI case logs were unavailable.

  • An unrelated MinIO-dependent Arrow integration test was skipped.

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

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

24 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Fri 30 Oct, 12:30 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 12:54 · edc925e

Reason

Pull request #31831 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.

Merge conditions: 2 of 3 met

This pull request

Condition Required by
✅ #review-threads-unresolved = 0 GitHub branch protection
✅ github-review-approved GitHub branch protection

The batch, tested in place

Condition Required by
❌ any of: check-neutral = CI Required, check-skipped = CI Required, check-success = CI Required GitHub branch protection

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

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

@XuPeng-SH
XuPeng-SH merged commit e6853b7 into matrixorigin:main Oct 30, 2026
21 of 22 checks passed
@mergify mergify Bot added dequeued and removed queued labels Oct 30, 2026
cpegeric added a commit to cpegeric/matrixone that referenced this pull request Oct 30, 2026
…error

parquet_vector_nonfinite (main matrixorigin#31831) expects main's message for a vecf16
and a vecbf16 element above the type's range. This PR rejects such an
element as out of range, naming the type and the input value, as the scalar
float16/bf16 types do; both inserts are still rejected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

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

[Bug]: Parquet LIST import bypasses vector NaN/Inf validation for VECF32/F64/F16/BF16

3 participants