@@ -482,24 +482,43 @@ impl ExecutionPlanProperties for &dyn ExecutionPlan {
482
482
}
483
483
}
484
484
485
- /// Describes the execution mode of an operator's resulting stream with respect
486
- /// to its size and behavior. There are three possible execution modes: `Bounded`,
487
- /// `Unbounded` and `PipelineBreaking`.
485
+ /// Describes the execution mode of the result of calling
486
+ /// [`ExecutionPlan::execute`] with respect to its size and behavior.
487
+ ///
488
+ /// The mode of the execution plan is determined by the mode of its input
489
+ /// execution plans and the details of the operator itself. For example, a
490
+ /// `FilterExec` operator will have the same execution mode as its input, but a
491
+ /// `SortExec` operator may have a different execution mode than its input,
492
+ /// depending on how the input stream is sorted.
493
+ ///
494
+ /// There are three possible execution modes: `Bounded`, `Unbounded` and
495
+ /// `PipelineBreaking`.
488
496
#[ derive( Clone , Copy , PartialEq , Debug ) ]
489
497
pub enum ExecutionMode {
490
- /// Represents the mode where generated stream is bounded, e.g. finite.
498
+ /// The stream is bounded / finite.
499
+ ///
500
+ /// In this case the stream will eventually return `None` to indicate that
501
+ /// there are no more records to process.
491
502
Bounded ,
492
- /// Represents the mode where generated stream is unbounded, e.g. infinite.
493
- /// Even though the operator generates an unbounded stream of results, it
494
- /// works with bounded memory and execution can still continue successfully.
503
+ /// The stream is unbounded / infinite.
495
504
///
496
- /// The stream that results from calling `execute` on an `ExecutionPlan` that is `Unbounded`
497
- /// will never be done (return `None`), except in case of error.
505
+ /// In this case, the stream will never be done (never return `None`),
506
+ /// except in case of error.
507
+ ///
508
+ /// This mode is often used in "Steaming" use cases where data is
509
+ /// incrementally processed as it arrives.
510
+ ///
511
+ /// Note that even though the operator generates an unbounded stream of
512
+ /// results, it can execute with bounded memory and incrementally produces
513
+ /// output.
498
514
Unbounded ,
499
- /// Represents the mode where some of the operator's input stream(s) are
500
- /// unbounded; however, the operator cannot generate streaming results from
501
- /// these streaming inputs. In this case, the execution mode will be pipeline
502
- /// breaking, e.g. the operator requires unbounded memory to generate results.
515
+ /// Some of the operator's input stream(s) are unbounded, but the operator
516
+ /// cannot generate streaming results from these streaming inputs.
517
+ ///
518
+ /// In this case, the execution mode will be pipeline breaking, e.g. the
519
+ /// operator requires unbounded memory to generate results. This
520
+ /// information is used by the planner when performing sanity checks
521
+ /// on plans processings unbounded data sources.
503
522
PipelineBreaking ,
504
523
}
505
524
0 commit comments