yahoNanJing commented on code in PR #4043:
URL: https://github.com/apache/arrow-datafusion/pull/4043#discussion_r1012583663
##########
datafusion/core/src/physical_plan/joins/hash_join.rs:
##########
@@ -270,6 +271,75 @@ impl ExecutionPlan for HashJoinExec {
self.schema.clone()
}
+ fn required_input_distribution(&self) -> Vec<Distribution> {
+ match self.mode {
+ PartitionMode::CollectLeft => vec![
+ Distribution::SinglePartition,
+ Distribution::UnspecifiedDistribution,
+ ],
+ PartitionMode::Partitioned => {
+ let (left_expr, right_expr) = self
+ .on
+ .iter()
+ .map(|(l, r)| {
+ (
+ Arc::new(l.clone()) as Arc<dyn PhysicalExpr>,
+ Arc::new(r.clone()) as Arc<dyn PhysicalExpr>,
+ )
+ })
+ .unzip();
+ vec![
+ Distribution::HashPartitioned(left_expr),
+ Distribution::HashPartitioned(right_expr),
+ ]
+ }
+ }
+ }
+
+ fn output_partitioning(&self) -> Partitioning {
+ let left_columns_len = self.left.schema().fields.len();
+ match self.mode {
+ PartitionMode::CollectLeft => match self.join_type {
+ JoinType::Inner | JoinType::Right =>
adjust_right_output_partitioning(
+ self.right.output_partitioning(),
+ left_columns_len,
+ ),
+ JoinType::RightSemi | JoinType::RightAnti => {
+ self.right.output_partitioning()
+ }
+ JoinType::Left
Review Comment:
Should these cases exist when the partition mode is CollectLeft?
--
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]