Skip to content

Apache DataFusion SQL Query Engine

Add notes for DataSinkExec (#17873)

xudong.wd3ca16e9a73d
diff --git a/datafusion/datasource/src/sink.rs b/datafusion/datasource/src/sink.rs
index 13404bccac..a8adb46b96 100644
--- a/datafusion/datasource/src/sink.rs
+++ b/datafusion/datasource/src/sink.rs
@@ -100,6 +100,11 @@ impl Debug for DataSinkExec {
impl DataSinkExec {
/// Create a plan to write to `sink`
+ /// Note: DataSinkExec requires its input to have a single partition.
+ /// If the input has multiple partitions, the physical optimizer will
+ /// automatically insert a Merge-related operator to merge them.
+ /// If you construct PhysicalPlan without going through the physical optimizer,
+ /// you must ensure that the input has a single partition.
pub fn new(
input: Arc<dyn ExecutionPlan>,
sink: Arc<dyn DataSink>,