From 9d05f1c8fbf677568932ac179eefdcc30f63f9dd Mon Sep 17 00:00:00 2001 From: Gwo Tzu-Hsing Date: Mon, 16 Dec 2024 18:18:36 +0800 Subject: [PATCH] Fix refactoring bug --- src/compaction/mod.rs | 10 ++++++++-- src/option.rs | 1 - src/record/mod.rs | 11 ++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/compaction/mod.rs b/src/compaction/mod.rs index 65b648e..3e263c0 100644 --- a/src/compaction/mod.rs +++ b/src/compaction/mod.rs @@ -76,9 +76,15 @@ where let mutable = mem::replace( &mut guard.mutable, - Mutable::new(&self.option, trigger_clone, self.manager.base_fs()).await?, + Mutable::new( + &self.option, + trigger_clone, + self.manager.base_fs(), + self.record_schema.clone(), + ) + .await?, ); - let (file_id, immutable) = mutable.into_immutable(&guard.record_instance).await?; + let (file_id, immutable) = mutable.into_immutable().await?; guard.immutables.push((file_id, immutable)); } else if !is_manual { return Ok(()); diff --git a/src/option.rs b/src/option.rs index ef7fde4..50d2394 100644 --- a/src/option.rs +++ b/src/option.rs @@ -28,7 +28,6 @@ pub struct DbOption { pub(crate) clean_channel_buffer: usize, pub(crate) base_path: Path, pub(crate) base_fs: FsOptions, - // TODO: DEBUG pub(crate) level_paths: Vec>, pub(crate) immutable_chunk_num: usize, pub(crate) immutable_chunk_max_num: usize, diff --git a/src/record/mod.rs b/src/record/mod.rs index 497d1dd..664f134 100644 --- a/src/record/mod.rs +++ b/src/record/mod.rs @@ -110,7 +110,16 @@ impl Schema for DynSchema { } fn primary_key_path(&self) -> (ColumnPath, Vec) { - unimplemented!() + ( + ColumnPath::new(vec![ + "_ts".to_string(), + self.schema[self.primary_index].name.clone(), + ]), + vec![ + SortingColumn::new(1_i32, true, true), + SortingColumn::new(self.primary_key_index() as i32, false, true), + ], + ) } }