Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rust/lance-namespace-impls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ reqwest = { version = "0.12", optional = true, default-features = false, feature
# Directory implementation dependencies (always enabled)
url = { workspace = true }
lance = { workspace = true }
lance-index = { workspace = true }
lance-io = { workspace = true }
object_store = { workspace = true }
arrow = { workspace = true }
Expand Down Expand Up @@ -65,6 +66,7 @@ tempfile.workspace = true
wiremock.workspace = true
arrow = { workspace = true }
arrow-ipc = { workspace = true }
rstest.workspace = true

[lints]
workspace = true
21 changes: 21 additions & 0 deletions rust/lance-namespace-impls/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub struct DirectoryNamespaceBuilder {
session: Option<Arc<Session>>,
manifest_enabled: bool,
dir_listing_enabled: bool,
inline_optimization_enabled: bool,
}

impl DirectoryNamespaceBuilder {
Expand All @@ -89,6 +90,7 @@ impl DirectoryNamespaceBuilder {
session: None,
manifest_enabled: true,
dir_listing_enabled: true, // Default to enabled for backwards compatibility
inline_optimization_enabled: true,
}
}

Expand All @@ -110,13 +112,24 @@ impl DirectoryNamespaceBuilder {
self
}

/// Enable or disable inline optimization of the __manifest table.
///
/// When enabled (default), performs compaction and indexing on the __manifest table
/// after every write operation to maintain optimal performance.
/// When disabled, manual optimization must be performed separately.
pub fn inline_optimization_enabled(mut self, enabled: bool) -> Self {
self.inline_optimization_enabled = enabled;
self
}

/// Create a DirectoryNamespaceBuilder from properties HashMap.
///
/// This method parses a properties map into builder configuration.
/// It expects:
/// - `root`: The root directory path (required)
/// - `manifest_enabled`: Enable manifest-based table tracking (optional, default: true)
/// - `dir_listing_enabled`: Enable directory listing for table discovery (optional, default: true)
/// - `inline_optimization_enabled`: Enable inline optimization of __manifest table (optional, default: true)
/// - `storage.*`: Storage options (optional, prefix will be stripped)
///
/// # Arguments
Expand Down Expand Up @@ -190,12 +203,19 @@ impl DirectoryNamespaceBuilder {
.and_then(|v| v.parse::<bool>().ok())
.unwrap_or(true);

// Extract inline_optimization_enabled (default: true)
let inline_optimization_enabled = properties
.get("inline_optimization_enabled")
.and_then(|v| v.parse::<bool>().ok())
.unwrap_or(true);

Ok(Self {
root: root.trim_end_matches('/').to_string(),
storage_options,
session,
manifest_enabled,
dir_listing_enabled,
inline_optimization_enabled,
})
}

Expand Down Expand Up @@ -262,6 +282,7 @@ impl DirectoryNamespaceBuilder {
object_store.clone(),
base_path.clone(),
self.dir_listing_enabled,
self.inline_optimization_enabled,
)
.await
{
Expand Down
Loading