Skip to content

Commit 2906a24

Browse files
authored
Minor: Improve documentation for PartitionStream and StreamingTableExec (#8035)
* Minor: Improve documentation for `PartitionStream` and `StreamingTableExec` * fmt * fmt
1 parent 8c42d94 commit 2906a24

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

datafusion/physical-plan/src/streaming.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//! Execution plan for streaming [`PartitionStream`]
18+
//! Generic plans for deferred execution: [`StreamingTableExec`] and [`PartitionStream`]
1919
2020
use std::any::Any;
2121
use std::sync::Arc;
@@ -35,6 +35,10 @@ use futures::stream::StreamExt;
3535
use log::debug;
3636

3737
/// A partition that can be converted into a [`SendableRecordBatchStream`]
38+
///
39+
/// Combined with [`StreamingTableExec`], you can use this trait to implement
40+
/// [`ExecutionPlan`] for a custom source with less boiler plate than
41+
/// implementing `ExecutionPlan` directly for many use cases.
3842
pub trait PartitionStream: Send + Sync {
3943
/// Returns the schema of this partition
4044
fn schema(&self) -> &SchemaRef;
@@ -43,7 +47,10 @@ pub trait PartitionStream: Send + Sync {
4347
fn execute(&self, ctx: Arc<TaskContext>) -> SendableRecordBatchStream;
4448
}
4549

46-
/// An [`ExecutionPlan`] for [`PartitionStream`]
50+
/// An [`ExecutionPlan`] for one or more [`PartitionStream`]s.
51+
///
52+
/// If your source can be represented as one or more [`PartitionStream`]s, you can
53+
/// use this struct to implement [`ExecutionPlan`].
4754
pub struct StreamingTableExec {
4855
partitions: Vec<Arc<dyn PartitionStream>>,
4956
projection: Option<Arc<[usize]>>,

0 commit comments

Comments
 (0)