From a44dc0f1ad5c04810bbc073bb259eabac475d39a Mon Sep 17 00:00:00 2001 From: Noah Treuhaft Date: Tue, 25 Aug 2026 14:49:57 -0400 Subject: [PATCH] runtime/vam/op: handle error in HashJoin.buildTable --- runtime/vam/op/hashjoin.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/runtime/vam/op/hashjoin.go b/runtime/vam/op/hashjoin.go index 69f2655447..f383439bc0 100644 --- a/runtime/vam/op/hashjoin.go +++ b/runtime/vam/op/hashjoin.go @@ -79,10 +79,10 @@ func (h *HashJoin) tableInit() error { var table map[string][]super.Value var left, right vio.Puller if rightBuf.EOS { - table = buildTable(rightBuf, h.rightKey) + table, err = buildTable(rightBuf, h.rightKey) left = leftBuf } else { - table = buildTable(leftBuf, h.leftKey) + table, err = buildTable(leftBuf, h.leftKey) right = rightBuf } h.hashJoin = &hashJoin{ @@ -97,16 +97,16 @@ func (h *HashJoin) tableInit() error { rightKey: h.rightKey, hits: make(map[string]bool), } - return nil + return err } -func buildTable(p vio.Puller, key expr.Evaluator) map[string][]super.Value { +func buildTable(p vio.Puller, key expr.Evaluator) (map[string][]super.Value, error) { var sb scode.Builder table := map[string][]super.Value{} for { - vec, _ := p.Pull(false) - if vec == nil { - break + vec, err := p.Pull(false) + if vec == nil || err != nil { + return table, err } rightKeyVec := key.Eval(vec) for i := range vec.Len() { @@ -118,7 +118,6 @@ func buildTable(p vio.Puller, key expr.Evaluator) map[string][]super.Value { table[key] = append(table[key], vector.ValueAt(&sb, vec, i).Copy()) } } - return table } // pullRace pulls from a and b concurrently until one reaches EOS. It returns