-
Notifications
You must be signed in to change notification settings - Fork 768
perf(compaction): skip building row-address maps when index remapping is not needed #7778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,8 +61,13 @@ pub trait IndexRemapper: Send + Sync { | |
| /// | ||
| /// Currently we don't have any options but we may need options in the future and so we | ||
| /// want to keep a placeholder | ||
| #[async_trait] | ||
| pub trait IndexRemapperOptions: Send + Sync { | ||
| fn create_remapper(&self, dataset: &Dataset) -> Result<Box<dyn IndexRemapper>>; | ||
| /// Creates a remapper when the dataset has indices that need row address remapping. | ||
| /// | ||
| /// Returns `None` when no remappable indices exist, allowing compaction to avoid | ||
| /// materializing an unused row address map. | ||
| async fn create_remapper(&self, dataset: &Dataset) -> Result<Option<Box<dyn IndexRemapper>>>; | ||
|
Comment on lines
+64
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
ast-grep outline rust/lance/src/dataset/optimize/remapping.rs --items all
rg -n -C3 'IndexRemapperOptions|create_remapper' rustRepository: lance-format/lance Length of output: 18111 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,120p' rust/lance/src/dataset/optimize/remapping.rs
printf '\n--- optimize.rs export ---\n'
sed -n '120,150p' rust/lance/src/dataset/optimize.rs
printf '\n--- index.rs impl ---\n'
sed -n '1,70p' rust/lance/src/dataset/index.rs
printf '\n--- search deprecated/compat hook ---\n'
rg -n -C2 'deprecated|compat|create_remapper|IndexRemapperOptions' rust/lance/src/datasetRepository: lance-format/lance Length of output: 50376 Preserve the existing remapper trait method for downstream implementations. 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
|
|
||
| #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] | ||
|
|
@@ -75,9 +80,10 @@ impl IndexRemapper for IgnoreRemap { | |
| } | ||
| } | ||
|
|
||
| #[async_trait] | ||
| impl IndexRemapperOptions for IgnoreRemap { | ||
| fn create_remapper(&self, _: &Dataset) -> Result<Box<dyn IndexRemapper>> { | ||
| Ok(Box::new(Self {})) | ||
| async fn create_remapper(&self, _: &Dataset) -> Result<Option<Box<dyn IndexRemapper>>> { | ||
| Ok(None) | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.