You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: statistical aggregates accept YEAR at binding but fail in the executor #30181
YEAR is accepted by MatrixOne's statistical-aggregate type checker, but the executor cannot construct the aggregate for that type and returns an internal error. MySQL 8.0.46 executes the same aggregate.
Reproduction
CREATETABLEt (y YEAR);
INSERT INTO t VALUES (2020), (2021), (2022);
SELECT VAR_POP(y) FROM t;
MySQL 8.0.46 returns:
0.6666666666666666
MatrixOne returns:
ERROR 20101 (HY000): internal error: unsupported type 'YEAR' for var/stddev
The explicit numeric control SELECT VAR_POP(CAST(y AS DOUBLE)) FROM t executes in MO and returns the MySQL value.
Scope / code path
The shared statistical-aggregate binder accepts YEAR through its supported numeric type set, so the query reaches executor construction. The executor then rejects YEAR as unsupported. This is a type-checker/executor mismatch, not the binding-time rejection tracked by #30180.
The compatibility contract has no YEAR statistical-aggregate exception, and open/closed issue search found no matching YEAR report.
Environment
MatrixOne local runtime commit: 2ce4e58af6f03b943ee288ffad81012766cf830a.
Current origin/main inspected at a53390c57de48ac280249ff0e88831e502e20fb0; the relevant aggregate binder and executor files are unchanged from the tested runtime. The runtime itself was not rebuilt at that newer SHA.
Activity
fix(aggexec): support YEAR input for variance/stddev aggregates (#30181…
XuPeng-SH commentedon Oct 16, 2026
转测 @Ariznawlll。
已在 main 提交
0723ae37b1183a03bac9eda16669dfc7e474dfb8对关联修复 #30365 完成本 issue 对应的定向验证,所测场景通过。已运行对应功能回归;本轮测试结果支持进入测试验收。
测试入口:
TestVarianceYearResults请在目标验收版本复核后决定关闭;本次转测保留 issue 为 OPEN。
Ariznawlll commentedon Oct 16, 2026
测试版本
main7387b96afd3f996379e2ff48faeace9e1790fc350bf5bc7058852c9069b8db7df40c260782dfb905已确认进入上述 main。原问题验证
按 issue 原 SQL 创建 YEAR 列并写入 2020、2021、2022。
VAR_POP(y)连续 3/3 次返回0.6666666666666666,不再报unsupported type 'YEAR' for var/stddev;同数据的VAR_POP(CAST(y AS DOUBLE))也是0.6666666666666666。Happy Path 覆盖
VAR_SAMP(y)=1、STDDEV_POP(y)=0.816496580927726、STDDEV_SAMP(y)=1;VAR_POP(DISTINCT y)=0.6666666666666666。VAR_POP(y)仍为0.6666666666666666。Unhappy Path 覆盖
invalid-year,3/3 次返回错误20301;每次拒绝后原 3 行保持不变,VAR_POP(y)仍为0.6666666666666666。失败没有留下部分写入。白盒验证
已有修复 UT
TestVarianceYearResults在该 main 上以-count=3运行通过;本次未新增或修改 Go UT。并发和外部故障注入不适用于该确定性聚合类型缺陷。回归测试
func_aggr_var_pop的 YEAR BVT 覆盖。03163dedbef6f9d74e0017507b0699f4b6082653,文件suites/14_issue_regression/t/issue_30181_year_statistical_aggregates.test与对应.result。独立核实正确数值后,定向比较 3/3 次、42/42 条语句通过。14_issue_regressionsuite 和集成 CI 尚未运行。本地定向结果不等同于集成 CI 通过,后续继续跟踪 PR 合入和 CI。测试证据
total=3 success=3 failed=0 skipped=0, stmts=42 ok=42 fail=0。测试结论
测试通过。
daviszhen commentedon Oct 20, 2026
最新 main 验证(2026-10-20)
基线:
309f618995af4ee23e3b9149365f4af77264090d;关联修复 PR:#30365。结论:原问题已解决。exact-main SQL 计算
VAR_POP(YEAR)得到0.6666666666666666,pkg/sql/colexec/aggexec对应测试通过。