Apache DataFusion SQL Query Engine
Minor: rename NestedLoopsJoin memory reservation for clarity (#6228)
Andrew Lamb10070f3b3593
diff --git a/datafusion/core/src/physical_plan/joins/nested_loop_join.rs b/datafusion/core/src/physical_plan/joins/nested_loop_join.rsindex 5908b8df93..17d1eddf55 100644--- a/datafusion/core/src/physical_plan/joins/nested_loop_join.rs+++ b/datafusion/core/src/physical_plan/joins/nested_loop_join.rs@@ -197,12 +197,13 @@ impl ExecutionPlan for NestedLoopJoinExec {) -> Result<SendableRecordBatchStream> {let join_metrics = BuildProbeJoinMetrics::new(partition, &self.metrics);- // Initialization of operator-level reservation- let operator_reservation =- MemoryConsumer::new("NestedLoopJoinExec").register(context.memory_pool());+ // Initialization reservation for load of inner table+ let load_reservation =+ MemoryConsumer::new(format!("NestedLoopJoinLoad[{partition}]"))+ .register(context.memory_pool());// Initialization of stream-level reservation- let stream_reservation =+ let reservation =MemoryConsumer::new(format!("NestedLoopJoinStream[{partition}]")).register(context.memory_pool());@@ -214,7 +215,7 @@ impl ExecutionPlan for NestedLoopJoinExec {self.left.clone(),context.clone(),join_metrics.clone(),- stream_reservation,+ load_reservation,)});let outer_table = self.right.execute(partition, context)?;@@ -227,7 +228,7 @@ impl ExecutionPlan for NestedLoopJoinExec {self.right.clone(),context.clone(),join_metrics.clone(),- stream_reservation,+ load_reservation,)});let outer_table = self.left.execute(partition, context)?;@@ -244,7 +245,7 @@ impl ExecutionPlan for NestedLoopJoinExec {visited_left_side: None,column_indices: self.column_indices.clone(),join_metrics,- reservation: operator_reservation,+ reservation,}))}@@ -1163,7 +1164,7 @@ mod tests {err.to_string(),"External error: Resources exhausted: Failed to allocate additional");- assert_contains!(err.to_string(), "NestedLoopJoinStream[0]");+ assert_contains!(err.to_string(), "NestedLoopJoinLoad[0]");}Ok(())diff --git a/datafusion/core/tests/memory_limit.rs b/datafusion/core/tests/memory_limit.rsindex 197a459085..a37b6306ec 100644--- a/datafusion/core/tests/memory_limit.rs+++ b/datafusion/core/tests/memory_limit.rs@@ -130,7 +130,7 @@ async fn join_by_expression() {"select t1.* from t t1 JOIN t t2 ON t1.service != t2.service",vec!["Resources exhausted: Failed to allocate additional",- "NestedLoopJoinStream[0]",+ "NestedLoopJoinLoad[0]",],1_000,)