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]: nullable VARCHAR CASE aggregate panics with bitmap external storage capacity exceeded #27432
The same condition grouped by event_type and source_hour also fails. A reduced derived-table shape still fails:
SELECTSUM(CASE WHEN action ='opened' THEN 1 ELSE 0 END)
FROM (SELECT action FROM github_events LIMIT1) AS x;
Expected behavior
The query should return:
31093
There are 31,093 rows where action = 'opened'.
Controls
All of the following return the correct value 31093:
SELECTCOUNT(*) FROM github_events WHERE action ='opened';
SELECTSUM(CASE WHEN COALESCE(action, '') ='opened' THEN 1 ELSE 0 END)
FROM github_events;
-- seq is NOT NULL and this upper bound covers every loaded rowSELECTSUM(CASE WHEN action ='opened' THEN 1 ELSE 0 END)
FROM github_events
WHERE seq <590187;
A plain projection (SELECT action = 'opened' ...) also succeeds. The same action data in a simpler comparison table succeeds, indicating a vector/storage-layout-sensitive execution bug rather than invalid input.
Stability
Latest-main executable: 3/3 failures.
Existing 6001 service: same query reproduced 3/3 with the same Bitmap-capacity error.
action is nullable: 460,938 NULLs, 98,186 non-NULL values, 31,093 opened values.
The nullable string comparison merges NULL bitmaps. The result bitmap uses external storage; attempting to expand it beyond the external capacity panics instead of producing a valid aggregate result.
Activity
Ariznawlll commentedon Sep 9, 2026
测试版本
maincd04bb4c1af5bc595e2147dc645dfa754f4c395b原问题验证
构造原问题同量级数据:590187 个 sequence slot、559124 行可见记录、460938 个 NULL
action、98186 个非 NULLaction、31093 个opened。SUM(CASE WHEN action='opened' THEN 1 ELSE 0 END)连续 3 轮返回31093,无 bitmap external-storage panic。Happy Path 覆盖
COALESCE(action, '')对照、派生表、按event_type/source_hour分组聚合均返回总数31093。559124/31093/98186/460938(总行/ opened/非 NULL/NULL)。Unhappy Path 覆盖
ERROR 1054;错误后同一高数据量表仍可返回opened=31093、action = NULL为0、action IS NULL为460938。白盒验证
修复前父提交
705d5fbb625d32090b9a8acadcead08c3e1d4535上,最小 external bitmap 合并测试稳定触发panic: bitmap external storage capacity exceeded;当前 main 运行TestOrTruncatesLongSourceForExternalResult、TestOrTruncatesLongSourceForExternalResultWithTwoInputs、TestOrExternalResultBoundaryCases均通过。回归测试
suites/14_issue_regression/t/issue_27432_nullable_varchar_case_aggregate.test14_issue_regression套件中该用例通过。测试证据
ad5d9b10c3401e613628755018b0d343893a7eaa测试结论
测试通过。