Skip to content

Commit

Permalink
refactor: produce BatchBuilder from a Batch to modify it again (#5186)
Browse files Browse the repository at this point in the history
chore: pub some mods
  • Loading branch information
MichaelScofield authored Dec 18, 2024
1 parent c33cf59 commit 18e8c45
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/mito2/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,18 @@ impl BatchBuilder {
}
}

impl From<Batch> for BatchBuilder {
fn from(batch: Batch) -> Self {
Self {
primary_key: batch.primary_key,
timestamps: Some(batch.timestamps),
sequences: Some(batch.sequences),
op_types: Some(batch.op_types),
fields: batch.fields,
}
}
}

/// Async [Batch] reader and iterator wrapper.
///
/// This is the data source for SST writers or internal readers.
Expand Down
2 changes: 1 addition & 1 deletion src/mito2/src/sst/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::sst::index::IndexOutput;
use crate::sst::DEFAULT_WRITE_BUFFER_SIZE;

pub(crate) mod file_range;
pub(crate) mod format;
pub mod format;
pub(crate) mod helper;
pub(crate) mod metadata;
mod page_reader;
Expand Down

0 comments on commit 18e8c45

Please sign in to comment.