Skip to content

Commit 37b61f5

Browse files
committed
handle mark columns
1 parent 5799f63 commit 37b61f5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

datafusion/physical-plan/src/joins/hash_join.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,15 @@ impl ExecutionPlan for HashJoinExec {
10161016
let references_right_columns = referenced_columns
10171017
.iter()
10181018
.any(|col| right_column_names.contains(col.name()));
1019+
// Some join types produce extra columns, e.g. `mark` columns in RightMark joins or LeftMark joins.
1020+
let references_non_child_columns = referenced_columns
1021+
.iter()
1022+
.any(|col| {
1023+
!left_column_names.contains(col.name())
1024+
&& !right_column_names.contains(col.name())
1025+
});
10191026

1020-
if references_left_columns && references_right_columns {
1027+
if references_non_child_columns || (references_left_columns && references_right_columns) {
10211028
// Filter references both sides - cannot push down, skip it
10221029
left_filters.push(PredicateSupport::Unsupported(Arc::clone(filter)));
10231030
right_filters.push(PredicateSupport::Unsupported(Arc::clone(filter)));

0 commit comments

Comments
 (0)