Skip to content

Fix Parquet LOAD with statistics - #32306

Closed
iamlinjunhong wants to merge 8 commits into
matrixorigin:mainfrom
iamlinjunhong:fix-parquet-statistics-32229
Closed

iamlinjunhong wants to merge 8 commits into
matrixorigin:mainfrom
iamlinjunhong:fix-parquet-statistics-32229

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Nov 6, 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:

issue #32229

What this PR does / why we need it:

Valid Parquet files with statistics could fail LOAD because the compact Thrift decoder consumed an extra byte when skipping an unknown boolean field. Correct the field skip in a locally maintained copy of parquet-go v0.25.1, preserving the existing writer statistics behavior and making the replacement module available in Docker build stages. The affected files now load with their complete values; files without statistics remain supported.

Validation

  • License CI repair (e3718d42aadf4cf48ca180ed2ef2de60ee09e5bd): license-eye -c .licenserc.yml header check passed (7,413 valid, zero invalid); dep check and missing-header rejection controls passed. GOWORK=off go test -mod=readonly -v -count=1 -timeout=120s ./encoding/thrift passed in the nested module. The repair preserves upstream licenses and adds the MatrixOne header to its local regression; runtime behavior is unchanged. Full Linux SCA remains for CI.
  • Current revision: SQL LOAD BVT covers the affected fixture, the no-statistics control, ordinary statistics and rollback cases; the load_data directory, stage and external table suites passed (five existing ignored cases in load_data).
  • Parquet/Thrift and writer tests cover field and collection decoding, page headers, indexes and footers. Five writer paths were compared against old output using pyarrow for rows, schema and field IDs; Go readers, Iceberg SQL writers, embedded read/delete and SQL integration Parquet paths passed.
  • Service build, module-layer checks, vet and lint passed. Five-sample local benchmarks showed median time changes of +0.15% to +3.14% and at most +0.48% B/op for the sampled paths; these are not full workload measurements.
  • Historical context: the issue author reported the original failure on an older revision. The pre-fix dependency also reproduced the footer error locally.
  • CI must validate the full container, native and GPU image builds: the Docker daemon and GPU environment were unavailable locally. Layered module checks passed, but are not full image builds.

The local replace does not propagate to downstream Go main modules; consumers must map the dependency themselves. An existing upstream V1 nullable multi-page reader limitation remains outside this fix.

@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 Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: e3718d42aadf4cf48ca180ed2ef2de60ee09e5bd

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: e3718d42aadf4cf48ca180ed2ef2de60ee09e5bd

Assessment: approve

The fix correctly handles compact boolean fields while preserving collection decoding and writer statistics. The local module matches the pinned dependency apart from the three-line fix; its documented maintenance cost is justified by the narrow behavior change.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Verified all 198 production files, retained upstream files, licenses, original fixtures and Docker module stages.

  • Nested Thrift and root Parquet tests passed. Baseline reproduced the footer error; candidate fixture checks verified complete values, controls and truncation rejection.

  • Reused frozen-head successful build, UT, SCA, coverage and active BVT statuses.

  • Receipts and logs reconciled in validation-evidence.json; final audit checks/1794212016599760110-2.json passed. Discussion assessment saved.

Limitations:

  • No fresh local SQL, native-consumer, performance or full Docker/GPU image runs.

  • Downstream Go main modules need their own replacement; automatic CreatedBy version discovery is reduced, as documented.

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

mergify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

❌ Left the queue · checks failed

1 h 49 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Mon 9 Nov, 09:47 · rule main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in place
  • 🚫 Left the queue 11:36 · f122c22

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

Requeue requested — the merge queue status continues in this comment ↓.

2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

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

Seems to be the wrong way of fixing upstream bugs.

Shouldn't this be done like we fork parquet-go in its own repo, use our version of go in using go.mod. Try to push the fix upstream. Up to origin maintainer to accept/fix/merge or whatever. We maintain sync with upstream until this is fix in upstream.

@XuPeng-SH

XuPeng-SH commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: f122c2232c8920cfd8b5060e83ca3ea6e4e4b351

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: f122c2232c8920cfd8b5060e83ca3ea6e4e4b351

Assessment: approve

The shared Thrift fix correctly distinguishes inline struct booleans from collection values and preserves writer behavior. The documented local module adds bounded maintenance cost. A separate fork is a reasonable alternative, but no mandatory policy or supported-consumer defect was established. The maintainer’s existing change request remains unresolved.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Preflight and the complete isolated nested Thrift suite passed. Logs and receipts are retained.

  • Removing only the guard makes the compact regression fail while binary still passes, confirming the test oracle.

  • Source audit passed: all 232 changed inputs match the prior reviewed head; checked 198 library production files, retained licenses, both issue fixtures and six Docker module stages.

  • Reused frozen current-head CI successes for build, UT, SCA, coverage and BVT. All seven discussion entries are assessed in discussion-assessment.json; execution receipts and logs are reconciled in validation-evidence.json.

Limitations:

  • Root tests did not compile locally: Go 1.26.6 is below required 1.27.1, and toolchain download timed out. Fresh upstream-module download also timed out.

  • Prior-review and raw CI logs were unavailable. No local service, native, benchmark, GPU or full Docker image run was claimed.

  • Downstream replacement and reduced CreatedBy version discovery are documented maintenance limits.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

⏳ Waiting for queue conditions

Enters the queue as soon as one of these 7 queue rules has nothing left.

Queue rule main · 2 of 8 left

Queue rule release-2.1 · 2 of 8 left

Queue rule release-2.2 · 2 of 8 left

4 other queue rules

Queue rule release-3.0 · 2 of 8 left

Queue rule release-4.0 · 2 of 8 left

Queue rule release-4.1 · 2 of 8 left

Queue rule release-4.2 · 2 of 8 left

Queue rule main: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-2.1: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-2.2: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-3.0: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-4.0: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-4.1: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections
Queue rule release-4.2: 6 met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required
  • -conflict
  • -draft
  • any of:
    • -mergify-configuration-changed
    • check-success = @mergify/Configuration changed
    • check-success = @mergify/Configuration has been deleted
  • any of:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections

Times in UTC · dashboard · how the merge queue works

Copy link
Copy Markdown
Contributor Author

Agreed, @fengttt — we should maintain the fix in a separate parquet-go fork, reference it via go.mod, and work with upstream instead of copying the library into MatrixOne.

This branch was previously deployed

1 inactive deployment
ci — f122c223 Deployed Nov 10, 2026 by mergify[bot]
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/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants