Skip to content

test(sql): cover NULL lag and lead defaults across partitions - #30020

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:mo-bot/issue-29925-7feb27e0b9db
Oct 12, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:mo-bot/issue-29925-7feb27e0b9db

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Test and CI

Which issue(s) this PR fixes:

Fixes #29925

What this PR does / why we need it:

Adds regression coverage for LAG/LEAD explicit NULL defaults across partitions of sizes two and one. The cleanup fix already merged in #29918 clears payload-free NULL-vector lengths; these tests verify the reported SQL behavior and protect that reuse contract.

SQL tests check untyped NULL, typed DOUBLE NULL, omitted, zero and row-dependent defaults, asserting every value and NULL bit. Vector coverage adds DOUBLE and shrinking, empty and growing lengths, retaining provenance and memory-cleanup assertions. Production code is unchanged.

Validation: focused normal and race checks passed 11 top-level tests per mode across vector, window and SQL integration, including all ten new SQL cases and existing cancellation/error/lifecycle controls, with no skips or race reports. Incremental gofmt and go vet passed; configured golangci-lint reported 0 issues. Molint ran over the same three packages; its two unsafe-import diagnostics are in unchanged files verified byte-identical to the base.

Tests used Go 1.27.1, CGO_ENABLED=1 and fresh native artifacts. Local SQL fixtures used a diagnostic configuration overlay changing only the Unix socket pathname to avoid Linux path-length limits; TCP query execution and assertions were unchanged. The final gpt-6.1-sol/xhigh review accepted the exact committed candidate. Remote CI remains pending.

Closes #29925

@XuPeng-SH
XuPeng-SH requested a review from aunjgr as a code owner October 12, 2026 11:55
@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 →

@mergify mergify Bot added the kind/test-ci label Oct 12, 2026
@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: c871dfe71f35cb918bebf7c8e22d4e40f5893ca1

Assessment: approve

Reviewed the complete two-file test delta, existing coverage, production callers and fixture lifecycle. Expected SQL values and NULL bits are correct; vector assertions preserve cleanup and provenance coverage. Production code is unchanged. No actionable defects found.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • Verified exact HEAD, clean source and correspondence with the frozen patch. git diff --check and gofmt checks passed.

  • Traced constant-NULL cleanup and reuse through UnionBatch, window argument evaluation and LAG/LEAD default selection.

  • Checked all ten SQL cases, row counts, ordering, error handling, connection cleanup and shared one-CN fixture reuse.

  • Compared existing regression coverage: several NULL cases overlap, while zero and row-dependent defaults and DOUBLE/length transitions add distinct coverage.

  • Reused author-reported normal and race validation: 11 top-level tests per mode, including all ten new SQL cases and existing cancellation/error/lifecycle controls.

  • Reviewed both supplied comments; neither raises a technical concern. Recorded evidence in review-audit.json and static-checks.json.

Limitations:

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

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

Assessment: approve

Reviewed the complete two-file test delta, existing coverage, production callers and fixture lifecycle. Expected SQL values and NULL bits are correct; vector assertions preserve cleanup and provenance coverage. Production code is unchanged. No actionable defects found.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • Verified exact HEAD, clean source and correspondence with the frozen patch. git diff --check and gofmt checks passed.

  • Traced constant-NULL cleanup and reuse through UnionBatch, window argument evaluation and LAG/LEAD default selection.

  • Checked all ten SQL cases, row counts, ordering, error handling, connection cleanup and shared one-CN fixture reuse.

  • Compared existing regression coverage: several NULL cases overlap, while zero and row-dependent defaults and DOUBLE/length transitions add distinct coverage.

  • Reused author-reported normal and race validation: 11 top-level tests per mode, including all ten new SQL cases and existing cancellation/error/lifecycle controls.

  • Reviewed both supplied comments; neither raises a technical concern. Recorded evidence in review-audit.json and static-checks.json.

Limitations:

  • Author validation lacks raw logs and exact commands; no local native tests were rerun. Substantive remote CI results are absent from the frozen snapshot.

  • The standalone issue #29925 body was not supplied; its contract was assessed from the PR description and SQL cases.

  • Added test runtime was not measured; the new SQL test reuses the existing shared cluster.

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot work · mo-bot-local · done

Commit: c871dfe71f35cb918bebf7c8e22d4e40f5893ca1

Confirmed the noop repair disposition. The Qodo account notification requires no source change, rebase or rerun. Existing PR CI remains pending; this result does not certify merge readiness.

This branch was previously deployed

1 inactive deployment
ci — 9666542d Deployed Oct 12, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: LAG/LEAD with NULL default panic across partitions; typed NULL returns wrong zero

2 participants