Skip to content

bug: hive 分区表 self-join 触发 invalid hash build budget(PR #25837 预算系统第 4 个 false rejection) #26413

Closed

Description

@Ariznawlll

问题

Big Data Test (main) hive 分区表 self-join 查询被 HashBuild 预算系统错误拒绝。

CI

失败 SQL

select a.part_id, count(*) as rowcount
from external_hive_partition_2000_large.fact_hive_2000 a
join external_hive_partition_2000_large.fact_hive_2000 b
on a.part_id = b.part_id and a.col_uuid = b.col_uuid
where a.part_id in (1, 7)
group by a.part_id order by a.part_id
Error 20101: internal error: invalid hash build budget
  • Expected: part_id=1 rowcount=50000, part_id=7 rowcount=50000
  • Actual: 执行直接报错

数据规模

  • hive 分区表 fact_hive_2000,2000 个分区
  • where part_id in (1, 7) 裁剪后约 100K 行
  • self-join on part_id + col_uuid
  • 数据量不大,不应该被预算拒绝

根因

PR #25837 引入的 HashBuild 内存/spill 预算准入系统(pkg/sql/colexec/hashbuild/budget.go)的 false rejection。

这是该系统的 第 4 个 false rejection 场景:

PR 场景 状态
#26178 reused tail batches spill budget ✅ 已修
#26231 runtime filter budget double-counting ✅ 已修
#26318 whole-payload multiplier double-counting ✅ 已修
本次 hive 分区外表 self-join ❌ 未修

budget.go 中有 20+ 处返回 ErrHashBuildBudgetInvalid,边界条件仍未完全覆盖。

关联问题

PR #25837 同时引起了:

/cc @aptend

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions