Skip to content

Commit 786e865

Browse files
committed
Update Delta table URL construction
1 parent 275268a commit 786e865

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • crates/arroyo-connectors/src/filesystem/sink

crates/arroyo-connectors/src/filesystem/sink/delta.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::FinishedFile;
2-
use anyhow::Result;
2+
use anyhow::{Result, anyhow};
33
use arrow::datatypes::Schema;
44
use arroyo_storage::{BackendConfig, R2Config, S3Config, StorageProvider};
55
use arroyo_types::to_millis;
@@ -87,7 +87,10 @@ pub(crate) async fn load_or_create_table(
8787
BackendConfig::Local(_) => (storage_provider.get_backing_store(), "/".to_string()),
8888
};
8989

90-
let mut delta = DeltaTableBuilder::from_url(&url)
90+
let table_url = Url::parse(&url).or_else(|_| {
91+
Url::from_directory_path(&url).map_err(|_| anyhow!("invalid Delta table URL: {url}"))
92+
})?;
93+
let mut delta = DeltaTableBuilder::from_url(table_url)?
9194
.with_storage_backend(backing_store, Url::parse(storage_provider.canonical_url())?)
9295
.build()?;
9396

0 commit comments

Comments
 (0)