Skip to content

Commit 9fa4d8d

Browse files
committed
fix(batch): fix left join with equi-conditions (#10165)
1 parent 1be5d60 commit 9fa4d8d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
statement ok
2+
SET RW_IMPLICIT_FLUSH TO true;
3+
4+
statement ok
5+
create table t1 (a bigint, b int);
6+
7+
statement ok
8+
create table t2 (c bigint, d int);
9+
10+
statement ok
11+
insert into t1 select 1, 1 from generate_series(1, 1111, 1);
12+
13+
statement ok
14+
insert into t2 values (10, 10);
15+
16+
query I
17+
select count(*) from t1 left join t2 on b = d and (a is null or a - 2 > 0);
18+
----
19+
1111
20+
21+
statement ok
22+
drop table t2;
23+
24+
statement ok
25+
drop table t1;

src/batch/src/executor/join/hash_join.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ impl<K: HashKey> HashJoinExecutor<K> {
497497
probe_row,
498498
build_data_types.len(),
499499
) {
500+
non_equi_state.first_output_row_id.clear();
500501
yield spilled
501502
}
502503
}

0 commit comments

Comments
 (0)