Skip to content

Commit

Permalink
Use HdfsObjectStore if scheme is equal to hdfs/viewfs
Browse files Browse the repository at this point in the history
  • Loading branch information
SchutteJan committed Jul 12, 2024
1 parent 55d052d commit 54364dd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kernel/src/engine/default/storage.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use hdfs_native_object_store::HdfsObjectStore;
use object_store::parse_url_opts as object_store_parse_url_opts;
use object_store::path::Path;
use object_store::{Error, ObjectStore};
Expand All @@ -9,5 +10,16 @@ where
K: AsRef<str>,
V: Into<String>,
{
let scheme = url.scheme();
if scheme == "hdfs" || scheme == "viewfs" {
let options_map = options
.into_iter()
.map(|(k, v)| (k.as_ref().to_string(), v.into()))
.collect();
let store = HdfsObjectStore::with_config(url.as_str(), options_map)?;
let path = Path::parse(url.path())?;
return Ok((Box::new(store), path));
}

object_store_parse_url_opts(url, options)
}

0 comments on commit 54364dd

Please sign in to comment.