Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 34e70f0

Browse files
committed
Fix assertion bug for Q20 and Q22
1 parent fa7e41e commit 34e70f0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

optd-datafusion-repr/src/rules/subquery/depjoin_pushdown.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ fn apply_dep_initial_distinct(
166166
),
167167
);
168168

169+
let new_dep_join_schema_size = correlated_col_indices.len() + right_schema_size;
169170
let new_dep_join =
170171
DependentJoin::new_unchecked(distinct_agg_node.into_plan_node(), right, cond, extern_cols);
171172

@@ -185,7 +186,7 @@ fn apply_dep_initial_distinct(
185186
.iter()
186187
.enumerate()
187188
.map(|(i, x)| {
188-
assert!(i + left_schema_size < left_schema_size + right_schema_size);
189+
assert!(i + left_schema_size < left_schema_size + new_dep_join_schema_size);
189190
BinOpPred::new(
190191
ColumnRefPred::new(*x).into_pred_node(),
191192
ColumnRefPred::new(i + left_schema_size).into_pred_node(),
@@ -201,7 +202,7 @@ fn apply_dep_initial_distinct(
201202
.iter()
202203
.enumerate()
203204
.map(|(i, _)| {
204-
assert!(i + left_schema_size < left_schema_size + right_schema_size);
205+
assert!(i + left_schema_size < left_schema_size + new_dep_join_schema_size);
205206
BinOpPred::new(
206207
pred.clone().into(),
207208
ColumnRefPred::new(i + left_schema_size).into_pred_node(),

0 commit comments

Comments
 (0)