Skip to content

fix(external): validate parquet decimal target precision - #26274

Merged
mergify[bot] merged 6 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26265
Jul 29, 2026
Merged

mergify[bot] merged 6 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26265

Conversation

@iamlinjunhong

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 #26265

What this PR does / why we need it:

fix(external): validate parquet decimal target precision

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

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Jul 28, 2026
@matrix-meow matrix-meow added size/M Denotes a PR that changes [100,499] lines and removed size/S Denotes a PR that changes [10,99] lines labels Jul 28, 2026
@iamlinjunhong

Copy link
Copy Markdown
Contributor Author

Deep-reviewed exact head 0509fcdab2091f941163b691a1cea66ba099a798. The Parquet change itself is sound: same-scale logical DECIMAL stays on the raw path only when source precision proves its value domain fits the target, while narrower targets use the precision-aware conversion for plain/dictionary DECIMAL64/128/256. One real concurrency blocker remains in the accompanying error-preservation logic.

P1 — A canceled sibling can still win before the real execution error

preferPrimaryScopeError only lets a substantive candidate replace ErrPipelineEndSignalDeliveryFailed (pkg/sql/compile/compile.go:469-487). In runOnce, results arrive in scheduler order. If a sibling observes the query cancellation first, errToThrowOut becomes context.Canceled or ErrQueryInterrupted; when the producer later publishes the actual Parquet DECIMAL overflow, the helper keeps the cancellation because current is no longer the synthetic delivery error (compile.go:620-637). This is reachable: dispatch/sendfunc/insert and VM paths directly return context.Canceled/ctx.Err() after another scope calls Proc.Cancel. The client can therefore still receive cancellation rather than the precision error this PR is trying to preserve.

Add the missing matrices current=context.Canceled, candidate=executionErr and current=ErrQueryInterrupted, candidate=executionErr; both currently fail. Avoid solving this with another static ranking that could overwrite a genuine client cancellation. Preserve/inspect the CancelCauseFunc cause (or carry causal scope/result metadata) so internally canceled siblings resolve to the error that triggered cancellation, while an externally canceled query still returns its external cause. Apply the same principle to nested MergeRun collection.

The current tests cover only cleanup-fallback-first ordering, so green CI does not exercise this production race.

fixed

@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-reviewed exact head b4a5119. The prior cancellation/error-causality blocker is fixed for both top-level and nested MergeRun paths while preserving genuine external cancellation. The Parquet DECIMAL precision routing is sound for plain and dictionary DECIMAL64/128/256. Focused race tests and full race tests for ./pkg/sql/compile ./pkg/sql/colexec/external passed.

@mergify mergify Bot added the queued label Jul 29, 2026
@mergify

mergify Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-07-29 04:12 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-07-29 05:28 UTC · at 382aefa3f841574708612fae912c2599c1d30bb5 · squash

This pull request spent 1 hour 16 minutes in the queue, including 36 minutes 4 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

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

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