wiedld commented on code in PR #7842:
URL: https://github.com/apache/arrow-datafusion/pull/7842#discussion_r1369068951
##########
datafusion/physical-plan/src/sorts/builder.rs:
##########
@@ -21,17 +21,15 @@ use arrow::record_batch::RecordBatch;
use datafusion_common::Result;
use datafusion_execution::memory_pool::MemoryReservation;
-#[derive(Debug, Copy, Clone, Default)]
-struct BatchCursor {
- /// The index into BatchBuilder::batches
- batch_idx: usize,
- /// The row index within the given batch
- row_idx: usize,
-}
+use super::batches::{BatchCursor, BatchId};
+use super::cursor::{Cursor, CursorValues};
+
+type YieldedSortOrder<C> = (Vec<SortOrder>, Vec<BatchCursor<C>>);
+type SortOrder = (BatchId, usize); // (batch_id, row_idx)
/// Provides an API to incrementally build a [`RecordBatch`] from partitioned
[`RecordBatch`]
#[derive(Debug)]
-pub struct BatchBuilder {
+pub struct SortOrderBuilder<C: CursorValues> {
Review Comment:
Yes, exactly. I just pushed [a commit with
documentation](https://github.com/apache/arrow-datafusion/pull/7842/commits/222c12a4ee9ad0c847b66dfefc168a7aabfa9e53)
-- to show where this was going.
I was trying to break up the change into 2 parts (see PR description). That
decision seems to have created confusion. 😅
##########
datafusion/physical-plan/src/sorts/builder.rs:
##########
@@ -21,17 +21,15 @@ use arrow::record_batch::RecordBatch;
use datafusion_common::Result;
use datafusion_execution::memory_pool::MemoryReservation;
-#[derive(Debug, Copy, Clone, Default)]
-struct BatchCursor {
- /// The index into BatchBuilder::batches
- batch_idx: usize,
- /// The row index within the given batch
- row_idx: usize,
-}
+use super::batches::{BatchCursor, BatchId};
+use super::cursor::{Cursor, CursorValues};
+
+type YieldedSortOrder<C> = (Vec<SortOrder>, Vec<BatchCursor<C>>);
+type SortOrder = (BatchId, usize); // (batch_id, row_idx)
/// Provides an API to incrementally build a [`RecordBatch`] from partitioned
[`RecordBatch`]
#[derive(Debug)]
-pub struct BatchBuilder {
+pub struct SortOrderBuilder<C: CursorValues> {
Review Comment:
Yes, exactly. I just pushed [a commit with
documentation](https://github.com/apache/arrow-datafusion/pull/7842/commits/222c12a4ee9ad0c847b66dfefc168a7aabfa9e53)
-- to show where this was going.
I was trying to break up the change into 2 parts (see PR description). That
decision seems to have created confusion. 😅
--
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]