Repository navigation
fix(window): widen narrow integer RANGE frame bounds - #30973
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Static review of the current head found no additional correctness issue in the widening path: narrow signed RANGE literals are carried as int64, then checked against the physical int8/int16/int32 domain before binary search; out-of-domain endpoints use the existing ASC/DESC insertion-boundary mapping. The added unit cases cover wide offsets in both sort directions and the BVT covers the reported TINYINT/SMALLINT/INT SQL forms. I have not independently executed tests. The only workflow run currently visible for this commit is Iceberg Connector E2E (success), which does not validate this window change; focused window tests and the window BVT still need executable CI evidence. I am leaving this as a comment review rather than approval until that evidence is available.
9d6b673 to
2f954ba
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Commit review for exact head 2f954baf21490fe20d7f2f498d1f2c71a2a398a7 (new commit fix(window): return plan type for widened range bounds). The follow-up now returns the plan.Type expected by window bound folding (T_int64.ToType().PlanType()), matching rangeFrameBoundType's contract. Static inspection of the full change found the narrow signed paths widen the offset, perform checked int64 arithmetic, and map out-of-domain endpoints to the ASC/DESC boundary before narrowing for binary search; coverage includes int8/int16/int32, both order directions in executor tests, older narrow literal representations, and SQL cases through INT64_MAX. I found no new actionable defect. This is not an approval yet: exact-head UT, UT coverage, SCA, and shared build are still queued/in progress, and the only completed end-to-end check currently visible is unrelated Iceberg CI. I could not execute the focused tests locally because this workspace contains no MatrixOne checkout/runtime.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Incremental review for exact head 2676d67c6a3f3a50ee83b37cdb785b84f9a7a5b6 (test(window): cover widened prepared range bounds). This commit updates prepared-frame planner assertions from int32 to int64 and adds executor-level wide signed offset cases for int8/int16/int32 in both ASC and DESC order; I found no defect in this test-only delta. I could not execute tests locally because this workspace has no MatrixOne checkout/runtime. The exact-head GitHub checks currently show only Iceberg-related jobs (one tidy job succeeded; another was skipped), plus neutral Mergify checks; there is no window UT/BVT evidence yet, and commit status remains pending. Please run the focused window package tests and window_numeric_range_wide_bound BVT before treating this as validated.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9d1f67f902ebfc66d73c8159636389411dd16753
Assessment: approve
Reviewed all six changed files and their planner/executor consumers. Separating offset width from physical key width is coherent: checked arithmetic precedes narrowing, existing boundary searches remain authoritative, and older literal forms remain supported. No actionable defects found. Added runtime work is limited to scalar checks on affected RANGE frames.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Reused frozen exact-head successful UT, coverage, SCA, shared-build and both BVT results; reconciled package and window-case selection with repository CI scripts.
-
Independent SQL probe passed 24 scenario groups in 4.86s: three signed widths, ASC/DESC, four frame forms, literal/prepared execution, signed extremes, NULL peers, invalid bounds and recovery. Expected results used arbitrary-precision arithmetic.
-
Isolation preflight, native provenance with 192 matching inputs, formatting, whitespace and clean-source checks passed.
-
Receipts, logs, diagnostic overlay and hashes were audited and retained under /home/xupeng/.local/state/mo-bot/jobs/ea4d39b63b6cef26bce95706/attempt-1/check-audit.json.
Limitations:
-
Frozen CI evidence contains terminal check metadata, not raw per-case logs. The linked issue body was absent; review used the frozen PR contract and supplied regressions.
-
No performance benchmark was run; no speed improvement is claimed.
Merge Queue Status
This pull request spent 4 hours 3 minutes 27 seconds in the queue, with no time running CI. ReasonPull request #30973 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.
HintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
…98a3a139bf269bd5329f8393ca5ea03dd8ce543
Fifth base update, resolving the DIRTY/CONFLICTING mergeability reported against head a4a7ef9: upstream main advanced to 80ea60a three commits past the merge-#4 base ac4ec31 (fix(window) matrixorigin#30973 widen narrow integer RANGE frame bounds; fix(plan) matrixorigin#31015 overlapping ON DELETE CASCADE/SET NULL order-independence; fix(frontend) matrixorigin#31052 preserve microseconds in session timestamp overrides). merge-tree pinned a single content conflict, pkg/sql/plan/window_binder_test.go, where matrixorigin#30973 appends TestRangeFrameBoundTypeWidening (plus T_int32->T_int64 prepared-marker assertion updates) at the same file tail this feature's TestQuantileExactWeightedDistinctWindowBinding occupies. Resolved semantically: both appended test functions are kept together with upstream's widened marker assertions; window_binder.go and window.go auto-merged this feature's DISTINCT window hook (bindWindowFuncExpr) beside upstream's rangeFrameBoundType call site (bindWindowSpec) and this feature's orderedSetWindowAggregate entry beside upstream's signedNarrowRangeBound/signedRangeOffsetValue additions, all disjoint regions. Upstream allocated no SQL function IDs in this range, so QUANTILE_EXACT_WEIGHTED = 619 and FUNCTION_END_NUMBER = 620 stand; no design decision, invariant, admission set or validation plan changed. The upstream range touches no .github and no mo-tester content. Validated by ladder v6 (mo-cgo-test): closure compile/link, the full aggexec quantile matrix, function/registry id checks, the plan binder seam set now including upstream's TestRangeFrameBoundTypeWidening and TestPreparedWindowRangeFrameMarkers*, the window operator set now including TestBuildRangeIntervalWideSignedBounds, the compile dispatch matrix and the parser corpus - every step exit 0; gofmt, git diff --check and git diff --cached --check clean. Logs preserved under issue-29944/merge5-conflict-resolution/logs/.
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Numeric RANGE window frame bounds were folded into the physical type of narrow signed ORDER BY keys, so valid bounds such as
200for TINYINT or2147483648for INT failed at plan time with an out-of-range error. This change keeps TINYINT, SMALLINT, and INT bounds in an int64 arithmetic domain, maps endpoints outside the physical key domain to the correct frame boundary, and preserves compatibility with older narrow bound literals.Regression coverage includes planner type selection, ASC/DESC runtime boundaries for preceding/following frames, and SQL cases for TINYINT, SMALLINT, and INT bounds through INT64_MAX.
Validation:
gofmt,git diff --check, and package resolution passed. Focused Go tests and end-to-end BVT execution remain pending because this worktree lacks the repository's CGo/native artifacts; compilation stops at the existingpkg/common/docfiltersymbolsC.mo_sorted64_build_fixedandC.mo_sorted64_free.After the PR is merged, please ask the issue reporter to verify the six reported SQL cases.