Skip to content

Commit bbb5cc7

Browse files
authored
Fix potential overflow when we print verbose physical plan (#17798)
* change debug to trace for potential overflow * fix comments. * fix
1 parent 8c8e565 commit bbb5cc7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

datafusion/core/src/physical_planner.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,15 @@ impl DefaultPhysicalPlanner {
21352135
"Optimized physical plan:\n{}\n",
21362136
displayable(new_plan.as_ref()).indent(false)
21372137
);
2138-
debug!("Detailed optimized physical plan:\n{new_plan:?}");
2138+
2139+
// Don't print new_plan directly, as that may overflow the stack.
2140+
// For example:
2141+
// thread 'tokio-runtime-worker' has overflowed its stack
2142+
// fatal runtime error: stack overflow, aborting
2143+
debug!(
2144+
"Detailed optimized physical plan:\n{}\n",
2145+
displayable(new_plan.as_ref()).indent(true)
2146+
);
21392147
Ok(new_plan)
21402148
}
21412149

0 commit comments

Comments
 (0)