comphead commented on code in PR #24336:
URL: https://github.com/apache/datafusion/pull/24336#discussion_r3778738896
##########
datafusion/physical-plan/src/joins/piecewise_merge_join/classic_join.rs:
##########
@@ -481,6 +481,18 @@ fn resolve_classic_join(
buffer_idx = buffered_null_idx;
stream_idx = stream_null_idx;
batch_process_state.processed_null_count = true;
+
+ // The scan below starts past the streamed side's NULL-keyed rows,
which
+ // sit at the front (`nulls_first`). A NULL join key never matches
under
+ // `NullEqualsNothing`, so for `Right`/`Full` those rows are unmatched
and
+ // must still be emitted; record them here since the scan will skip
them.
+ if matches!(join_type, JoinType::Right | JoinType::Full) {
+ for row_idx in 0..stream_null_idx {
+ batch_process_state
+ .unmatched_indices
+ .append_value(row_idx as u32);
+ }
Review Comment:
```suggestion
for row_idx in 0..stream_null_idx as u32 {
batch_process_state.unmatched_indices.append_value(row_idx);
}
```
this would cast only once
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]