Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data
data_csv
./results/
results
venv
!sql_benchmarks/**/results/
30 changes: 21 additions & 9 deletions datafusion/core/src/physical_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ use crate::physical_plan::explain::ExplainExec;
use crate::physical_plan::filter::FilterExecBuilder;
use crate::physical_plan::joins::utils as join_utils;
use crate::physical_plan::joins::{
CrossJoinExec, HashJoinExec, NestedLoopJoinExec, PartitionMode, SortMergeJoinExec,
CrossJoinExec, HashJoinExec, NestedLoopJoinExecBuilder, PartitionMode,
SortMergeJoinExec,
};
use crate::physical_plan::limit::{GlobalLimitExec, LocalLimitExec};
use crate::physical_plan::projection::{ProjectionExec, ProjectionExpr};
Expand Down Expand Up @@ -1668,13 +1669,12 @@ impl DefaultPhysicalPlanner {
let left_side = side_of(lhs_logical)?;
let right_side = side_of(rhs_logical)?;
if left_side == Side::Both || right_side == Side::Both {
return Ok(Arc::new(NestedLoopJoinExec::try_new(
return build_nested_loop_join(
physical_left,
physical_right,
join_filter,
join_type,
None,
)?));
*join_type,
);
}

if left_side == Side::Right && right_side == Side::Left {
Expand Down Expand Up @@ -1709,13 +1709,12 @@ impl DefaultPhysicalPlanner {
)?)
} else {
// there is no equal join condition, use the nested loop join
Arc::new(NestedLoopJoinExec::try_new(
build_nested_loop_join(
physical_left,
physical_right,
join_filter,
join_type,
None,
)?)
*join_type,
)?
}
} else if session_state.config().target_partitions() > 1
&& session_state.config().repartition_joins()
Expand Down Expand Up @@ -2371,6 +2370,19 @@ fn extract_update_assignments(input: &Arc<LogicalPlan>) -> Result<Vec<(String, E
Ok(assignments)
}

fn build_nested_loop_join(
physical_left: Arc<dyn ExecutionPlan>,
physical_right: Arc<dyn ExecutionPlan>,
join_filter: Option<join_utils::JoinFilter>,
join_type: JoinType,
) -> Result<Arc<dyn ExecutionPlan>> {
Ok(Arc::new(
NestedLoopJoinExecBuilder::new(physical_left, physical_right, join_type)
.with_filter(join_filter)
.build()?,
))
}

/// Check if an assignment is an identity assignment (column = column)
/// These are columns that are not being modified in the UPDATE
fn is_identity_assignment(expr: &Expr, column_name: &str) -> bool {
Expand Down
Loading