Skip to content

Commit

Permalink
ListingTableProvider missing storage_options
Browse files Browse the repository at this point in the history
The `ListingTableProvider` used to gather `delta tables` from an `object_store` did not passed the `storage_options` (connection details) to the `object_store` library. Therefore, nothing was happening. This PR fixes that specific issue
  • Loading branch information
Nordalf committed Oct 5, 2024
1 parent 8701046 commit 57e6e0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/core/src/data_catalog/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ impl ListingSchemaProvider {
storage_options: Option<HashMap<String, String>>,
) -> DeltaResult<Self> {
let uri = ensure_table_uri(root_uri)?;
let storage_options = storage_options.unwrap_or_default().into();
let storage_options: StorageOptions = storage_options.unwrap_or_default().into();
// We already parsed the url, so unwrapping is safe.
let store = store_for(&uri)?;
let store = store_for(&uri, &storage_options)?;
Ok(Self {
authority: uri.to_string(),
store,
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ pub fn factories() -> FactoryRegistry {
}

/// Simpler access pattern for the [FactoryRegistry] to get a single store
pub fn store_for(url: &Url) -> DeltaResult<ObjectStoreRef> {
pub fn store_for(url: &Url, storage_options: &StorageOptions) -> DeltaResult<ObjectStoreRef> {
let scheme = Url::parse(&format!("{}://", url.scheme())).unwrap();
if let Some(factory) = factories().get(&scheme) {
let (store, _prefix) = factory.parse_url_opts(url, &StorageOptions::default())?;
let (store, _prefix) = factory.parse_url_opts(url, storage_options)?;
Ok(store)
} else {
Err(DeltaTableError::InvalidTableLocation(url.clone().into()))
Expand Down
4 changes: 2 additions & 2 deletions crates/core/tests/fs_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use deltalake_core::kernel::{
use deltalake_core::operations::create::CreateBuilder;
use deltalake_core::operations::transaction::CommitBuilder;
use deltalake_core::protocol::{DeltaOperation, SaveMode};
use deltalake_core::storage::{GetResult, ObjectStoreResult};
use deltalake_core::storage::{GetResult, ObjectStoreResult, StorageOptions};
use deltalake_core::DeltaTable;
use object_store::path::Path as StorePath;
use object_store::{
Expand Down Expand Up @@ -152,7 +152,7 @@ impl SlowStore {
_options: impl Into<deltalake_core::storage::StorageOptions> + Clone,
) -> deltalake_core::DeltaResult<Self> {
Ok(Self {
inner: deltalake_core::storage::store_for(&location)?,
inner: deltalake_core::storage::store_for(&location, &StorageOptions::default())?,
})
}
}
Expand Down

0 comments on commit 57e6e0c

Please sign in to comment.