Skip to content

feat(sql): add ewmMean/ewmVar/ewmStd/ewmCov/ewmCorr window functions - #31941

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-29945-main-877fa298
Oct 31, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-29945-main-877fa298

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Oct 31, 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:

Related to #29945

What this PR does / why we need it:

MatrixOne had no exponentially weighted window statistics. Issue #29945 asks for the pandas-style ewm family at the SQL level: ewmMean, ewmVar, ewmStd, ewmCov and ewmCorr over a window frame, with alpha (or the string tag halflife) decay and the constant policies adjust, ignoreNA and minPeriods. Before this change none of the pipeline stages knew about these functions, so users had to pull the data out and post-process it.

The change adds the whole path, and each stage needed its own repair because the general window machinery could not express this family:

  • No grammar existed for the five names or for a window function whose first argument is a value column followed by positional configuration arguments (pkg/sql/parsers/dialect/mysql/keywords.go, mysql_sql.y, mysql_sql.go): the parser now accepts the 2-7 argument positional forms, with halflife as a string literal decay tag and the names kept identifier-compatible.
  • The bound window spec carried only the function name, so the policies had no safe transport. Binding window policies as folded plan literals would silently clamp execution-dependent values (second(current_timestamp()) = 1) and over-wide decimals to one compile-time value and would let constant folding hide the dependency from the cache gates. pkg/sql/plan/window_binder.go (with query_builder.go, utils.go, function/function.go, function_id.go, list_window.go) binds constant alpha/halflife/policies immediately, keeps marker-decay and execution-dependent arguments unfolded, types the decay/policy argument positions, deduces the EWM outputs as nullable float64, and classifies execution-dependent EWM plans so the frontend can exclude them from both the prepare-compile cache and the mixed-runtime specialization cache (pkg/frontend/computation_wrapper.go, types.go).
  • minPeriods had no typed resolution path: a fractional constant would be silently truncated to an integral threshold and a value above int32 was rejected outright. pkg/sql/compile/operator.go now resolves minPeriods in the original plan type (bool to 0/1; integral integer spellings carried exactly; float64 required integral and finite; decimal64/128/256 tested with the exact raw significand-vs-scale remainder, so no fractional spelling can slip through, including the 65-digit fraction that float64 alone would round to one), saturates above-int64 values at math.MaxInt64, and rejects non-finite policy constants (NaN/+Inf/-Inf) with the family error.
  • The indexed window operator assumed a query-scoped constant specification and could not accept configuration per execution, which prepared statements need. pkg/sql/colexec/window/ewm_dispatch.go admits the per-execution configuration into the priority-queue container ahead of any allocation (capacity and ordering errors leave no partial state), emits each peer group exactly once, preserves partition isolation, and honors the bounded cancellation contract; pkg/sql/colexec/aggexec/ewm_config.go carries the resolved EwmConfig{Mode, Alpha, HalfLife, Adjust, IgnoreNA, MinPeriods} across the operator boundary with a strict length-gated decode. The pkg/sql/colexec/window/ewm engine evaluates the adjust/ignoreNA recurrences for mean, variance, covariance and correlation in row and event-time modes, publishes NULL while the running observation count is below max(1, minPeriods), and computes correlation with the zero-variance rule (NULL rather than a divide by zero).
  • Arrays of expected SQL semantics are frozen in test/distributed/cases/window/ewm_statistics.sql / ewm_statistics.result: profile vectors (e.g. values 1,2,3,4 with alpha=.5, adjust=false publish 1, 1.5, 2.25, 3.125), partitions, ties, all-NULL and NULL-clock inputs, constant signals, pair statistics with the zero-variance rule, the event-time corpus, minPeriods boundary and rejection blocks, constant/non-integer policy rejections with session recovery (SELECT 1 after each error), prepared marker forms, and regression rows for AVG/var_pop/stddev_pop beside the new functions.

Validation (issue #29945 -> tests):

  • Grammar: pkg/sql/parsers/dialect/mysql TestEwmWindowFunctionGrammar (all five names, decay/halflife/policy forms parse; invalid arities and bare usage reject) and TestEwmNamesRemainIdentifierCompatible.
  • Binding: pkg/sql/plan TestEwmBinderRejections and TestEwmBinderAcceptances (the constant-policy catalog: non-constant or out-of-range alpha, boolean-typed policy positions, wrong arities all reject), TestEwmMarkerDecayBindsDecimal256HalfLife, TestEwmDomainlessNullSamplesBindAsFloat64, TestEwmWindowOutputsRemainNullable, TestEwmRealTimeConfigClassifiesExecutionDependent.
  • Configuration: pkg/sql/compile TestConstructEwmConfig (valid forms and the invalid families), TestConstructEwmConfigMinPeriodsIntegrality, TestConstructEwmConfigMinPeriodsUpperBound, TestConstructEwmConfigNonFinitePolicy, TestValidateEwmWindowConfigsAfterModeResolution (event-time mode requires one ascending numeric ORDER BY key).
  • Wire: pkg/sql/colexec/aggexec TestEwmConfigRoundTrip, TestEwmConfigDecode (the widened record round-trips at MinPeriods 2147483648 and math.MaxInt64).
  • Operator and engine: pkg/sql/colexec/window TestEwmDispatchSplitPeerExactlyOnce, TestEwmDispatchPartitionIsolation, TestEwmDispatchLimitThenResetResumesFromScratch, TestEwmDispatchErrorThenCleanReuse, TestEwmDispatchCancellationMidGroup, TestEwmDispatchConfigChannelDrivesRows, TestEwmDispatchDecimalKeys, TestEwmDispatchEventIgnoreNAPartitionsIndexLocally, TestEwmDispatchPeerDirectoryAdmission; pkg/sql/colexec/window/ewm TestOracleVectors (204 frozen expectation vectors, bit-exact), TestEvaluatorSliceResumability, TestNonFiniteSampleRejection, TestKeyDomainRules, TestEventTimeNullInstantClock, TestMergePhaseCancellation, TestDdsumResidualCancellation.
  • Frontend: pkg/frontend TestShouldCachePrepareCompileRejectsEwmParameter, TestPreparedEwmDisablesMixedRuntimeSpecializationCache, TestPreparedEwmMarkerDecayKeepsRowModeOrderLatitude, TestPreparedEwmRealTimeConfigIsExcludedFromBothCaches.
  • User-visible SQL behavior: test/distributed/cases/window/ewm_statistics.sql (377 mo-tester statements). The expected result was regenerated against a launched development instance and then verified with two clean comparison runs at rate=100 (368/368 statements each, error file empty). The committed .result file extends the previously accepted result with insertion-only edits (a mechanical comparison of the file against its predecessor reports zero replaced or deleted lines).

Regression proof for the minPeriods defect (the routed family existed neither in grammar nor engine before this change, so the pre-fix witness is the SQL probe): on the parent tree the same probe silently published rows for fractional minPeriods constants (a threshold of 2 became an effective 1), published NULL rows for an -1 float bound, and raised error 20301 for the 2147483648 spelling; the identical .sql case file now publishes the exact profile for the integral 2.0 bound, returns the family error for every fractional/non-finite spelling while the session stays usable, and carries 2147483647/2147483648/4611686018427387905 exact. The pre-fix unit-level run of TestConstructEwmConfigMinPeriodsIntegrality failed during fixture construction ("can't be converted to Decimal64(18,18)") because the cast-bound decimal fixtures are also introduced by this change; the integrality acceptance itself is witnessed by the SQL probe above. Both tests are green on the final tree.

Focused test commands (single-package batches, run from the repository root on the committed tree):

GOEXPERIMENT=simd CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" \
  go test -mod=readonly -count=1 -timeout=20m -run 'Ewm' github.com/matrixorigin/matrixone/pkg/sql/compile
GOEXPERIMENT=simd CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" \
  go test -mod=readonly -count=1 -timeout=20m -run 'Ewm' github.com/matrixorigin/matrixone/pkg/sql/colexec/aggexec
GOEXPERIMENT=simd CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" \
  go test -mod=readonly -count=1 -timeout=20m -run 'Ewm' github.com/matrixorigin/matrixone/pkg/sql/colexec/window
GOEXPERIMENT=simd CGO_CFLAGS="-I$(pwd)/cgo -I$(pwd)/thirdparties/install/include" \
  go test -mod=readonly -count=1 -timeout=20m github.com/matrixorigin/matrixone/pkg/sql/colexec/window/ewm

Each of the four batches reports ok (exit 0) on the committed tree. The parser, plan and frontend packages were also green in focused batches during development and are byte-identical in this commit.

The BVT comparison runs are performed with the repository's standard mo-tester flow on a locally launched development instance (launch config under a scratch directory, MySQL on an isolated port, both ewm_stat databases dropped after the run and the service stopped with its listeners released).

Residual risks and limitations:

  • The five new names are window-only: bare calls error, and every error case in the BVT leaves a usable session (verified with recovery rows).
  • Spelled decimal(M) grammar caps M at 65, so the widest spelled precision usable in a constant policy is decimal(65,x). Bare plain numeric literals up to 76 digits bind into the DECIMAL256 carrier and are accepted, which is why the integral minPeriods test is implemented over raw decimal256 significands (a fraction that float64 rounds to one still rejects), not over a float64 interpolation.
  • minPeriods spellings above int64 saturate at math.MaxInt64 instead of erroring (the gate then publishes NULL), which follows the design's "no upper limit" rule.
  • Event-time decay computes one exact per-instant transcendental per distinct key; the focused benchmarks in pkg/sql/colexec/window/ewm/bench_test.go record both modes (row decay at ~0.67us/row over one-row peer groups; event-time distinct instants at ~70us/row).
  • The window configuration record widened (24 -> 28 bytes) with the same version tag; decode uses a strict length gate so a mixed-version session degrades rather than misinterprets.
  • Broader package suites (for example the full pkg/sql/... tree and the complete distributed BVT set) are left to CI; this PR's focused proofs cover each stage of the new family plus the AVG/variance regression rows in the new BVT file.

Rebase onto main (2026-10-31) — conflict resolution and validation

Mergify's Rule: Auto update branch (update) failed because main had advanced and the branch reported mergeStateStatus=DIRTY. The branch was rebased onto current main (4f894474ad10e1b9dc338868145a118a71c1fa23, 270 commits ahead of the old base) with semantic resolution of the overlapping features that landed for the sibling window-kernel families:

  • Function IDs: main allocated 605..623 (technical-indicator kernels feat: technical-indicator window kernels and rolling risk analytics #31017, local sliding-window ranks feat(sql): add local sliding-window ranks mrank, cumrank, tmrank #31020, quantileExactWeighted, unsigned-decimal admission, mo_index_sub_part). The EWM family renumbered 605..609 -> 624..628 and FUNCTION_END_NUMBER 610 -> 629. Every reference is by the named constant, so the renumbering is behavior-neutral; the ID pins in pkg/sql/plan/function/function_id_test.go now cover 624..628 together with main's own 605..623 pins.
  • Parser: the five ewm tokens joined main's extended non-reserved keyword set and window-function grammar; mysql_sql.go was regenerated with the repository's goyacc generator from the merged grammar (exit 0, zero shift/reduce conflicts, the Makefile's own gate), and TestEwmWindowFunctionGrammar/TestEwmNamesRemainIdentifierCompatible plus the full pkg/sql/parsers/dialect/mysql package pass.
  • Window operator: main's full-partition results refactor (fix(window): reuse full and cumulative RANGE aggregates #31553/perf: reuse full-partition windows and hash mixed EXISTS #31585) replaced the ordered-set partition-result cache the EWM teardown used to ride on. The EWM state release (freeEwmState) now hangs on the new lifecycle points beside freeFullPartitionResults/freeIndicatorState in Reset, Free and the per-generation eval entry, and the dispatch switch keeps both families: main's indicator kernels first, then the EWM processors, before the generic value/order/aggregate paths.
  • Local validation service: the base update also refreshed the pinned native thirdparty (usearch 2.26.5-20261030) required by the new go.mod replace; the worktree's stale prebuilt artifacts were rebuilt with the repository's own make cgo (provenance flow) before any test was rerun.

Validation rerun after the resolution (branch head effb9768d9, single commit on 4f894474ad):

  • Unit tests, all fresh -count=1 batches through the repository CGo wrapper, each ok (exit 0): pkg/sql/parsers/dialect/mysql (1.052s), pkg/sql/plan/function with the renumbered ID pins (53.042s), pkg/sql/colexec/aggexec (9.030s), pkg/sql/colexec/window (9.923s), pkg/sql/colexec/window/ewm (0.859s), pkg/sql/compile -run Ewm (1.566s), pkg/sql/plan -run Ewm (1.478s), pkg/frontend -run Ewm (1.859s).
  • Whole-tree link integrity: mo-service built from the rebased tree (272597714 bytes) after make cgo.
  • SQL-level BVT on that binary through the standard mo-tester flow against an isolated dev instance (private launch config, MySQL on a private port). The first comparison run reported 363/368 (98%, mo-tester exit 1) with five statement mismatches, all traced to behavior main itself changed in the meantime rather than to the EWM code:
    • two metadata-only SHOW COLUMNS header rows (Field[1,0,0] -> Field[12,-1,0] in ctas_m9/ctas_c9): main fix: make SHOW metadata identifiers safe #31033 (42b5912ac3, T_char -> T_varchar metadata) regenerates its own BVT .result headers; the same regeneration applies here.
    • three non-finite-policy rows (the cast('NaN' as double) / cast('-Infinity' as double) spellings and the prepared NaN EXECUTE): the expected family rejection did not fire because those string literals now convert to 0.0 through the ordinary MySQL string-to-double conversion; see main fix(function): keep NaN/Inf FLOAT/DOUBLE prepared parameters non-finite #31838 (f17a2c6204, which keeps NaN/Inf values for FLOAT/DOUBLE prepared parameters while ordinary SQL string literals keep the MySQL conversion). The test was adapted, not weakened: the three spellings now construct genuinely non-finite doubles through the IEEE bit pattern (bit_cast(unhex('000000000000f87f') as double) for NaN and ...f0ff for negative infinity), exactly the construction main's own test/distributed/cases/prepare/prepared_nonfinite_float_param.sql uses. The round-7 invariant is preserved: non-finite adjust/ignoreNA constants still raise invalid input: invalid argument: ewm statistics require constant adjust and ignoreNA booleans, the failing prepared EXECUTE still leaves the statement usable, and finite 0/1 spellings still resolve.
  • The expected .result was regenerated with the standard mo-tester genrs flow on the same isolated instance. A mechanical comparison against the pre-rebase result reports exactly five replaced lines — the three statement echoes for the new bit-cast spellings and the two SHOW COLUMNS metadata headers — with every outcome row unchanged, including both family-error rejections and the prepared EXECUTE error/recovery pair.
  • Final comparison run: TOTAL: 368, SUCCESS: 368, FAILED: 0, SUCCESS RATE: 100% (mo-tester exit 0). Both BVT runs, the probe runs and the regeneration used isolated report/classpath directories; the dev service was stopped with SIGTERM honored after each run and its MySQL listener verified released.

SCA err-check fix (2026-10-31): moerr-only error construction

CI run 41156869916 failed its Matrixone CI execution / SCA Test on Linux/arm64 job at the err-check gate of make static-check-analysis: this branch's new pkg/sql/colexec/window/ewm/engine.go still used errors.New, while the repository's own Makefile gate requires moerr-constructed errors throughout non-test pkg/ ("Use moerr instead").

The fix rounds out the last non-moerr error constructions of the branch:

  • The three package-level contract errors are moerr singletons now. ErrNonFiniteSample/ErrDecimalGapOverflow use moerr.NewInvalidInputNoCtx, rendering byte-for-byte as the design contract texts invalid input: ewm sample values must be finite and invalid input: ewm decimal key gaps exceed the decimal domain (verified by direct rendering), and pointer identity is retained, so the equality assertions in engine_test.go and the dispatch Contains assertions keep their meaning.
  • ErrBadConfig uses moerr.NewBadConfigNoCtx (the repo's bad-configuration family) with the same alpha/half-life message suffix. Its only operator consumer already folds it through moerr.NewInternalErrorNoCtx(err.Error()) at the decoded-config boundary, and no SQL/BVT surface asserts the old invalid argument: prefix, so the family rename stays internal to the decode boundary.
  • The two walker invariants (ewm: non-sequential output request, ewm: peer-group walker desynchronized) use moerr.NewInternalErrorNoCtx.

Verification after the change (all fresh -count=1 runs through the repository CGo wrapper, on the rebased tree):

  • Err-check re-simulation over non-test pkg/ files: zero fmt.Errorf/errors.New remain anywhere in this tree's pkg/ (main itself has none), including this PR's files.
  • pkg/sql/colexec/window/ewm full package suite and pkg/sql/colexec/window full package suite pass (they pin the singleton identities and the rejected-sample error lists).
  • Focused EWM suites in pkg/sql/colexec/aggexec, pkg/sql/parsers/dialect/mysql, pkg/sql/plan/function, pkg/sql/plan, pkg/sql/compile and pkg/frontend pass unchanged (-run 'Ewm|EWM|ewm'), and the repo's own lint stage (molint check + golangci-lint run via make static-check-selected) on the PR's packages is clean.

Known residue, unrelated to this branch: the same SCA tree-wide gate also flags context.WithTimeout/context.WithDeadline categories, and every one of those hits lives in files this branch never touches and is byte-identical at the base commit 4f894474ad (pkg/cdc/sinker_v2_executor.go:633, pkg/fileservice/disk_cache.go:1098, plus further cdc/cnservice/proxy/frontend/clusterservice files). A no-change proposal against today's main fails those two categories exactly the same way, so repairing them belongs to main, outside this PR's scope; no open issue currently tracks that residue at the time of this update.

Additionally, to keep the same SCA job's molint check stage green once it stops at err-check, the repository's checkunsafe allowlist rule (the linter pins exactly which files may import unsafe; pkg/sql/colexec/window/window.go is this package's pre-approved allocation-owner file) prompted two layout-accounting relocations, both behavior-neutral:

  • pkg/sql/colexec/window/ewm/engine.go: RetainedAccountBytes now sizes the two value layouts through reflect (reflect.TypeOf((*Evaluator)(nil)).Elem().Size() and the same for Out, computed once at init; no value copy), so the file no longer imports unsafe.
  • pkg/sql/colexec/window/ewm_dispatch.go: the staged-row sizing factors ewmRowSize/ewmKeySize moved into the whitelisted window.go (same package, next to this operator's existing unsafe.Sizeof accounting), and the dispatch file itself stays unsafe-free; all references are unchanged package-scope identifiers.

The same preemptive lint pass also cleared golangci-lint's own findings in the branch's files (the SCA job never reached that analyzer on the failing head): one copyloopvar (c := c) in engine_test.go and five unused private helpers left over from earlier iterations (nopPoller in engine.go; isZeroPair, isNumZero, isScalarFloat, xsub in x.go) are removed; every one of them had zero references anywhere in the tree and no public or cross-package use (all are package-private).

Review-22 fix (2026-10-31): runtime-constant admission for constant-expression configs

iamlinjunhong's review (head 8e8b448e, REQUEST_CHANGES) flagged the binder constancy gate: it used function.IsConstant(arg, true) — the foldability policy, whose fid == CASE branch rejects every CASE node — so a statement-level constant CASE in a decay or policy position (and IFNULL, which binding lowers to CASE) was rejected with ewm statistics require constant decay and policy arguments even though §4 admits constant expressions and the per-execution configuration evaluation (§9) already owns them. Valid finding, fixed in 4161c0b69e.

  • pkg/sql/plan/window_binder.go validateEwmWindowCallSignatures now judges input-row independence per execution (function.IsRuntimeConstant): a constant CASE/IFNULL config binds and reaches constructEwmConfig like its literal equivalent. Column-dependent CASE trees, volatile CASE branches (rand()) and nested aggregate/window calls keep the §7 rejection; markers, session variables and real-time trees are admitted exactly as before and stay flagged execution-dependent by PreparedPlanHasEwmParams (so a marker inside a CASE now resolves per execution as well).
  • Reproduction at head 8e8b448 and post-fix pass, same tests: pkg/sql/plan TestEwmConstantExpressionConfigs — the 7 constant CASE/IFNULL acceptance rows (reviewer's witness in the adjust position, decay/ignoreNA/minPeriods positions, cov/corr shifted positions) all bind-fail at the previous head with the spurious error and all 11 rows (acceptance plus column-dependent policy/decay, column-through-IFNULL and volatile-branch rejections) pass on the fixed tree, fresh -count=1 batches through the repository CGo wrapper; the whole pkg/sql/plan -run Ewm batch stays green.
  • New pkg/sql/compile TestEwmConstantCaseConfigEvaluation pins the per-execution evaluation the admission now reaches: an unfolded constant CASE evaluates to the identical decoded EwmConfig as its literal equivalent for the adjust policy (adjust=false), the binding-lowered IFNULL shape (case(isnull(x), y, x)), the numeric decay (alpha 0.5 row mode) and the CASE-spelled 'halflife' tag (event-time mode, h=3600). The pkg/sql/compile -run Ewm batch is green.
  • Live SQL pair on the reviewer's exact witness through the development instance (isolated runtime, private port): ERROR 20301 ... ewm statistics require constant decay and policy arguments on the pre-fix binary; 1, 1.5 on the fixed binary. ewmmean(x, CASE WHEN TRUE THEN 0.5 ELSE 0.25 END) publishes 1, 1.6666666666666667 (adjust defaults true — the frozen adjT profile), the IFNULL spelling publishes 1, 1.5, the column-dependent CASE WHEN id > 1 policy keeps the §7 error, and the literal spellings are unchanged.
  • BVT test/distributed/cases/window/ewm_statistics.sql gained the requested rows — constant CASE/IFNULL spellings in the decay/policy positions that publish exactly the frozen literal profiles (1, 1.5, 2.25, 3.125 for alpha .5 adjust false; the adjT rows for the CASE-decay default form; the adjF variance rows), and the column-dependent spellings that keep the §7 error texts with session recovery (select 1 as recover_case). The .result was regenerated through the standard mo-tester genrs flow on the fixed binary: the diff against the previous file is insertion-only. A clean comparison run on the whole file reports TOTAL: 377, SUCCESS: 377, FAILED: 0, SUCCESS RATE: 100% (mo-tester exit 0). Both runs used isolated report/classpath directories and the dev service was stopped with its MySQL and logservice listeners verified released after every phase.

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Oct 31, 2026
@mergify mergify Bot added the kind/feature label Oct 31, 2026
@gouhongshen
gouhongshen force-pushed the agent/issue-29945-main-877fa298 branch from b7bca85 to effb976 Compare October 31, 2026 01:45
Implement the exponentially weighted window statistics with
alpha/halflife decay and constant adjust and ignoreNA policies plus a
typed minPeriods publication threshold:

- parser: five function names with 2-7 argument positional forms and
  the 'halflife' decay tag
- plan: the window binder routes constant and marker-decay arguments
  and keeps execution-dependent ewm plans out of compile caches
- compile: minPeriods resolution in the original plan type with exact
  integral checks over float64 and decimal64/128/256 spellings
- window: per-execution configuration channel, exactly-once peer
  dispatch and the frozen-oracle EWM engine with a bounded
  cancellation contract
- frontend: prepared statements resolve ewm configuration per
  execution in the plan cache gates
- tests: focused unit tests per stage and a BVT suite covering the
  SQL-level semantics (368 mo-tester statements)

Related to matrixorigin#29945
@XuPeng-SH

XuPeng-SH commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 4161c0b69e41f78eb1c491c73395965e0ae032bf

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: 4161c0b69e41f78eb1c491c73395965e0ae032bf

Assessment: approve

The prior CASE/IFNULL configuration rejection is resolved. Current validation and qualified earlier coverage close the affected contracts; no actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Planner and compiler suites passed, including 11 new binder cases and the original eight-case review probe.

  • Real MySQL execution passed all 377 fixture statements, repeated prepared CASE configurations, and event-time ordering controls.

  • Qualified 27 historical receipts and logs for unchanged numerical, parser, lifecycle and race coverage, preserving their original failure classifications.

  • Recorded validation-audit.json and discussion-assessment.json; all 10 discussion keys covered and source unchanged.

Limitations:

  • Fresh execution used Linux/amd64 and one CN; no CI or multi-CN rerun.

  • MySQL replay validates values, NULLs, ordering and errors, but not JDBC-specific metadata formatting.

  • Reused evidence retains the documented frontend fixture overlay and numerical-oracle qualifications.

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

Reviewed head 4161c0b69e41f78eb1c491c73395965e0ae032bf against base 4f894474ad10e1b9dc338868145a118a71c1fa23. APPROVE — no remaining in-scope findings were confirmed.

The previous constant CASE/IFNULL admission defect is fixed. The author explicitly replied in the original thread. Comparing the reviewed and current code confirms that IsRuntimeConstant admits row-independent CASE trees while still rejecting column-dependent, volatile, aggregate and window expressions. The new binder tests, compiler configuration tests and SQL fixtures cover the repaired path; per-execution configuration and both prepared-cache exclusions remain consistent with it. The duplicate finding in review 5721551416 also received an explicit author response.

CI/check status follows the supplied review data: 30 checks: 14 success, 14 skipped, 2 neutral. None failed or remained running, but they are not all success. CI Required succeeded, as did UT, SCA, coverage and the selected multi-CN BVT checks.

Validation in this review: read-only code/diff and call-chain inspection, previous-feedback reconciliation, and the PR artifact check (passed). Local tests and service startup were skipped because the relevant regression coverage is committed and exact-head CI is available; author-reported local SQL runs were not independently rerun. git diff --check reports two trailing-space lines in the formatted SQL result fixture; these are not functional findings. Source files were unchanged; no GitHub write was performed.

@mergify mergify Bot added the queued label Oct 31, 2026
@mergify

mergify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

❌ Left the queue · checks failed

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

So far

  • ✅ Entered the queue Sat 31 Oct, 07:53 · rule main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in place
  • 🚫 Left the queue 09:30 · 43469bf

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, comment @mergifyio queue 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

Requeued — 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

@mergify

mergify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

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

So far

  • ✅ Entered the queue Sat 31 Oct, 10:55 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 12:07 · c31421c

Reason

Pull request #31941 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.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You 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.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

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

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request
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

@mergify mergify Bot removed the dequeued label Oct 31, 2026

This branch was previously deployed

1 inactive deployment
ci — c31421cc Deployed Oct 31, 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/feature size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants