LiaCastaneda commented on code in PR #21068:
URL: https://github.com/apache/datafusion/pull/21068#discussion_r3032917411


##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -1062,47 +1062,35 @@ pub(crate) fn build_batch_empty_build_side(
     column_indices: &[ColumnIndex],
     join_type: JoinType,
 ) -> Result<RecordBatch> {
-    match join_type {
-        // these join types only return data if the left side is not empty, so 
we return an
-        // empty RecordBatch
-        JoinType::Inner
-        | JoinType::Left
-        | JoinType::LeftSemi
-        | JoinType::RightSemi
-        | JoinType::LeftAnti
-        | JoinType::LeftMark => 
Ok(RecordBatch::new_empty(Arc::new(schema.clone()))),
+    if join_type.empty_build_side_produces_empty_result() {
+        // These join types only return data if the left side is not empty.
+        return Ok(RecordBatch::new_empty(Arc::new(schema.clone())));
+    }

Review Comment:
   nit: should we keep this? this is technically unreachable no? 🤔 



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