Commit 3e1f856
docs: clarify error semantics of in-place plan rewriting
Address review feedback on the in-place optimizer rewrite:
- Document the error contract of `rewrite_plan_in_place`: on `Err` the
plan is left in an unspecified state because `rule.rewrite()` consumes
it by value, and explain why it cannot be recovered without the clone
the function exists to avoid. Note how `Optimizer::optimize` handles it.
- Move the `mem::take` bridge explanation from the doc comment into an
inline comment next to the code it describes.
- Drop the inaccurate "Arc refcount is 1 is always true" claim.
- Document that `LogicalPlan::map_children_mut` does not roll back
partial mutations when `f` fails.
Comment-only changes; no behavior change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7d5359f commit 3e1f856
2 files changed
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
405 | 413 | | |
406 | 414 | | |
407 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | 368 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
375 | 384 | | |
376 | 385 | | |
377 | 386 | | |
| |||
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
385 | 398 | | |
386 | 399 | | |
387 | 400 | | |
| |||
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
517 | 536 | | |
518 | 537 | | |
519 | 538 | | |
| |||
0 commit comments