adriangb commented on code in PR #21068:
URL: https://github.com/apache/datafusion/pull/21068#discussion_r3025907085
##########
datafusion/physical-plan/src/joins/utils.rs:
##########
Review Comment:
This method is currently called from `HashJoinStream::process_probe_batch`.
Should we remove that branch / check from there? My understanding is we're
hoisting it up so that we avoid reading any of the probe side. And if that's
the case, can we delete `build_batch_empty_build_side`?
##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -855,6 +855,22 @@ pub(crate) fn need_produce_result_in_final(join_type:
JoinType) -> bool {
)
}
+/// Returns true when an empty build side necessarily produces an empty result.
+///
+/// This is the shared source of truth for both state-machine short-circuiting
+/// and `build_batch_empty_build_side`.
+pub(crate) fn empty_build_side_produces_empty_result(join_type: JoinType) ->
bool {
+ matches!(
+ join_type,
+ JoinType::Inner
+ | JoinType::Left
+ | JoinType::LeftSemi
+ | JoinType::LeftAnti
+ | JoinType::LeftMark
+ | JoinType::RightSemi
+ )
+}
+
Review Comment:
Maybe a method on `JoinType`?
--
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]