refactor: Move the logic for getting the input paths into FilesToSplitOrCompact
parent
e2dcf0b5e9
commit
a20c5dcd8b
|
@ -306,12 +306,9 @@ async fn run_plans(
|
|||
scratchpad_ctx: &mut dyn Scratchpad,
|
||||
) -> Result<Vec<ParquetFileParams>, DynError> {
|
||||
// stage files
|
||||
let input_paths: Vec<ParquetFilePath> = split_or_compact
|
||||
.files()
|
||||
.iter()
|
||||
.map(|f| (*f).into())
|
||||
.collect();
|
||||
let input_uuids_inpad = scratchpad_ctx.load_to_scratchpad(&input_paths).await;
|
||||
let input_uuids_inpad = scratchpad_ctx
|
||||
.load_to_scratchpad(&split_or_compact.file_input_paths())
|
||||
.await;
|
||||
let files_inpad: Vec<_> = split_or_compact
|
||||
.files()
|
||||
.into_iter()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use data_types::{CompactionLevel, ParquetFile};
|
||||
use parquet_file::ParquetFilePath;
|
||||
|
||||
/// A file classification specifies the parameters for a single compaction branch.
|
||||
///
|
||||
|
@ -99,6 +100,11 @@ impl FilesToSplitOrCompact {
|
|||
}
|
||||
}
|
||||
|
||||
/// Paths to the files for giving to the scratchpad.
|
||||
pub fn file_input_paths(&self) -> Vec<ParquetFilePath> {
|
||||
self.files().iter().map(|f| (*f).into()).collect()
|
||||
}
|
||||
|
||||
/// References to the inner Parquet files
|
||||
pub fn files(&self) -> Vec<&ParquetFile> {
|
||||
match self {
|
||||
|
|
Loading…
Reference in New Issue