comphead commented on code in PR #13134:
URL: https://github.com/apache/datafusion/pull/13134#discussion_r1819500197
##########
datafusion/physical-plan/src/joins/sort_merge_join.rs:
##########
@@ -784,6 +790,29 @@ fn get_corrected_filter_mask(
corrected_mask.extend(vec![Some(false); null_matched]);
Some(corrected_mask.finish())
}
+ JoinType::LeftMark => {
+ for i in 0..row_indices_length {
+ let last_index =
+ last_index_for_row(i, row_indices, batch_ids,
row_indices_length);
+ if filter_mask.value(i) && !seen_true {
+ seen_true = true;
+ corrected_mask.append_value(true);
+ } else if seen_true || !filter_mask.value(i) && !last_index {
+ corrected_mask.append_null(); // to be ignored and not set
to output
+ } else {
+ corrected_mask.append_value(false); // to be converted to
null joined row
+ }
+
+ if last_index {
+ seen_true = false;
+ }
+ }
+
+ // Generate null joined rows for records which have no matching
join key
+ let null_matched = expected_size - corrected_mask.len();
+ corrected_mask.extend(vec![Some(false); null_matched]);
Review Comment:
I'll create a ticket to replace filtered masks to use new method if its
faster
--
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]