This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 85be509e72 Make streaming_merge public (#6874)
85be509e72 is described below
commit 85be509e726be3c9767be25f090eb38eef344370
Author: KAZUYUKI TANIMURA <[email protected]>
AuthorDate: Sat Jul 8 10:22:04 2023 -0700
Make streaming_merge public (#6874)
* expose streaming_merge
* address review comments
* address review comments
---
datafusion/core/src/physical_plan/sorts/merge.rs | 8 ++++++--
datafusion/core/src/physical_plan/sorts/mod.rs | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/datafusion/core/src/physical_plan/sorts/merge.rs
b/datafusion/core/src/physical_plan/sorts/merge.rs
index e191c044b9..736df7dbe8 100644
--- a/datafusion/core/src/physical_plan/sorts/merge.rs
+++ b/datafusion/core/src/physical_plan/sorts/merge.rs
@@ -15,6 +15,9 @@
// specific language governing permissions and limitations
// under the License.
+//! Merge that deals with an arbitrary size of streaming inputs.
+//! This is an order-preserving merge.
+
use crate::physical_plan::metrics::BaselineMetrics;
use crate::physical_plan::sorts::builder::BatchBuilder;
use crate::physical_plan::sorts::cursor::Cursor;
@@ -51,8 +54,9 @@ macro_rules! merge_helper {
}};
}
-/// Perform a streaming merge of [`SendableRecordBatchStream`]
-pub(crate) fn streaming_merge(
+/// Perform a streaming merge of [`SendableRecordBatchStream`] based on
provided sort expressions
+/// while preserving order.
+pub fn streaming_merge(
streams: Vec<SendableRecordBatchStream>,
schema: SchemaRef,
expressions: &[PhysicalSortExpr],
diff --git a/datafusion/core/src/physical_plan/sorts/mod.rs
b/datafusion/core/src/physical_plan/sorts/mod.rs
index 567de96c1c..dff39db423 100644
--- a/datafusion/core/src/physical_plan/sorts/mod.rs
+++ b/datafusion/core/src/physical_plan/sorts/mod.rs
@@ -20,7 +20,7 @@
mod builder;
mod cursor;
mod index;
-mod merge;
+pub mod merge;
pub mod sort;
pub mod sort_preserving_merge;
mod stream;