Skip to content

Commit 5e29431

Browse files
committed
bugfix: localfs
1 parent 0a73e87 commit 5e29431

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

src/metastore/metastores/object_store_metastore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ impl Metastore for ObjectStoreMetastore {
733733

734734
async fn list_streams(&self) -> Result<HashSet<String>, MetastoreError> {
735735
// using LocalFS list_streams because it doesn't implement list_with_delimiter
736-
if PARSEABLE.get_storage_mode_string() == "drive" {
736+
if PARSEABLE.storage.name() == "drive" {
737737
PARSEABLE
738738
.storage
739739
.get_object_store()

src/query/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,15 @@ pub async fn get_manifest_list(
579579
stream_name,
580580
manifest_item.time_lower_bound,
581581
manifest_item.time_upper_bound,
582-
Some(manifest_item.manifest_path),
582+
Some(manifest_item.manifest_path.clone()),
583583
)
584584
.await?;
585585
let manifest = manifest_opt.ok_or_else(|| {
586586
QueryError::CustomError(format!(
587-
"Manifest not found for {stream_name} [{} - {}]",
588-
manifest_item.time_lower_bound, manifest_item.time_upper_bound
587+
"Manifest not found for {stream_name} [{} - {}], path- {}",
588+
manifest_item.time_lower_bound,
589+
manifest_item.time_upper_bound,
590+
manifest_item.manifest_path
589591
))
590592
})?;
591593
all_manifest_files.push(manifest);

src/storage/localfs.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,19 @@ impl ObjectStorage for LocalFS {
139139
}
140140
async fn get_object(&self, path: &RelativePath) -> Result<Bytes, ObjectStorageError> {
141141
let time = Instant::now();
142-
let file_path = self.path_in_root(path);
142+
let file_path = if path.to_string().contains(&self.root.to_str().unwrap()[1..]) {
143+
#[cfg(windows)]
144+
{
145+
path.to_path("")
146+
}
147+
#[cfg(not(windows))]
148+
{
149+
path.to_path("/")
150+
}
151+
} else {
152+
self.path_in_root(path)
153+
};
154+
143155
let res: Result<Bytes, ObjectStorageError> = match fs::read(file_path).await {
144156
Ok(x) => Ok(x.into()),
145157
Err(e) => match e.kind() {

0 commit comments

Comments
 (0)