comphead commented on code in PR #20710:
URL: https://github.com/apache/datafusion/pull/20710#discussion_r2886756472


##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -998,9 +1003,17 @@ pub(crate) fn build_batch_from_indices(
     probe_indices: &UInt32Array,
     column_indices: &[ColumnIndex],
     build_side: JoinSide,
+    join_type: JoinType,
 ) -> Result<RecordBatch> {
     if schema.fields().is_empty() {
-        return new_empty_schema_batch(schema, build_indices.len());
+        // For RightAnti and RightSemi joins, after 
`adjust_indices_by_join_type`
+        // the build_indices were untouched so only probe_indices hold the 
actual
+        // row count.
+        let row_count = match join_type {
+            JoinType::RightAnti | JoinType::RightSemi => probe_indices.len(),

Review Comment:
   should `RightMark` be in the list?



-- 
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]

Reply via email to