Skip to content

fix(iceberg): normalize date pruning literals - #27205

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27200
Aug 17, 2026
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27200

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

What this PR does / why we need it:

fix(iceberg): normalize date pruning literals

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

No blocking findings on 76b7e2b280d5c009d6332f09c163bdce950faf26.

The conversion is at the correct boundary: MO Literal_Dateval carries the internal absolute-day encoding, while Iceberg date bounds and year/month/day transforms consume days since 1970-01-01. Normalizing once in icebergPruneLiteralFromPlanLiteral keeps identity/data-file statistics and transformed partition pruning in the same Iceberg domain, including negative pre-epoch values.

Validation performed:

  • Full changed-package tests for compile, Iceberg metadata/write, and the local E2E runner passed.
  • Focused date-normalization, transformed-partition, strict-boundary, and E2E tests passed under -race -count=20.
  • Ran a real MinIO + Nessie + MatrixOne E2E on this exact head. Full scan, equality, the 2020 range repeated three times, IN, pre-epoch, NULL, and no-match predicates all returned the expected results; all other local Iceberg cases passed too.
  • Counterfactual check: temporarily restoring the old unnormalized value reproduced the bug exactly (6/155 full scan, but equality and all three 2020 ranges returned 0/NULL). Restoring this PR's conversion made the same real E2E pass.

Non-blocking CI note: the Iceberg E2E Local workflow is currently hard-disabled with if: false, and the aggregate local target presently stops in an unrelated nested-adapter go mod tidy check. The regression itself is valid and passed when I ran the actual service stack directly.

@mergify mergify Bot added the queued label Aug 17, 2026
@mergify

mergify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-17 05:26 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-17 06:51 UTC · at 478bb2797ed8b598f244f2b40bb7c326db491a9b · squash

This pull request spent 1 hour 24 minutes 39 seconds in the queue, including 47 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 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
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

@aptend aptend 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 76b7e2b280d5c009d6332f09c163bdce950faf26, including the complete review history and the pruning path from MO plan literals into Iceberg identity and transformed partition domains. No blocking finding.

The conversion belongs at icebergPruneLiteralFromPlanLiteral: MO DATE stores absolute days, while Iceberg DATE statistics and transforms consume Unix-epoch days. Applying DaysSinceUnixEpoch() once keeps identity pruning, year transforms, strict range boundaries, and negative pre-epoch values in the same domain without changing non-DATE literals.

The regression matrix includes pre-epoch/epoch/post-epoch unit controls and a public year-partition E2E covering full scan, equality, repeated range pruning, IN, NULL, no-match, and residual-filter explain behavior. Controlled CGo full tests passed for pkg/sql/compile and test/iceberg; focused tests passed under -race -count=3; go list/build/vet and diff checks are clean.

@mergify
mergify Bot merged commit f2146c8 into matrixorigin:main Aug 17, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Aug 17, 2026
@iamlinjunhong
iamlinjunhong deleted the m-27200 branch August 23, 2026 17:14
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
fix(iceberg): normalize date pruning literals

Approved by: @XuPeng-SH, @aptend
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
fix(iceberg): normalize date pruning literals

Approved by: @XuPeng-SH, @aptend
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
fix(iceberg): normalize date pruning literals

Approved by: @XuPeng-SH, @aptend

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.

4 participants