kosiew commented on code in PR #25490:
URL: https://github.com/apache/datafusion/pull/25490#discussion_r4061805819


##########
datafusion/physical-plan/src/joins/sort_merge_join/exec.rs:
##########
@@ -949,3 +890,114 @@ impl SortMergeJoinExec {
         ))
     }
 }
+
+/// The two sorted inputs of one partition of a sort-merge join, and how to
+/// join them.
+pub(crate) struct SortMergeJoinInputs {
+    /// The join schema (before any projection)
+    pub(crate) schema: SchemaRef,
+    /// Sort options of the join keys, one per key, that both inputs are 
sorted with
+    pub(crate) sort_options: Vec<SortOptions>,
+    pub(crate) null_equality: NullEquality,
+    /// Left input, sorted on `on_left` with `sort_options`
+    pub(crate) left: SendableRecordBatchStream,
+    /// Right input, sorted on `on_right` with `sort_options`
+    pub(crate) right: SendableRecordBatchStream,
+    pub(crate) on_left: Vec<PhysicalExprRef>,
+    pub(crate) on_right: Vec<PhysicalExprRef>,
+    pub(crate) filter: Option<JoinFilter>,
+    pub(crate) join_type: JoinType,
+    pub(crate) partition: usize,
+}
+
+/// Joins two sorted inputs with the sort-merge join algorithm.
+///
+/// Picks the streamed and buffered side by join type and the join stream
+/// implementation by join type family, exactly as [`SortMergeJoinExec`] does;
+/// the hash join's sort-merge fallback uses this too. The stream's metrics are

Review Comment:
   Small documentation suggestion: this says the hash join fallback "uses this 
too," but this commit does not have a caller outside `SortMergeJoinExec` yet. 
Could we say it "will use this" or remove that clause so the documentation 
reflects the current code?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to