diff --git a/src/mito2/src/manifest/storage.rs b/src/mito2/src/manifest/storage.rs index b136faac3862..483ec6e1cac9 100644 --- a/src/mito2/src/manifest/storage.rs +++ b/src/mito2/src/manifest/storage.rs @@ -163,15 +163,20 @@ impl ManifestObjectStore { /// Return all `R`s in the root directory that meet the `filter` conditions (that is, the `filter` closure returns `Some(R)`), /// and discard `R` that does not meet the conditions (that is, the `filter` closure returns `None`) + /// Return an empty vector when directory is not found. pub async fn get_paths(&self, filter: F) -> Result> where F: Fn(Entry) -> Option, { - let streamer = self - .object_store - .list(&self.path) - .await - .context(OpenDalSnafu)?; + let streamer = match self.object_store.list(&self.path).await { + Ok(streamer) => streamer, + Err(e) if e.kind() == ErrorKind::NotFound => { + debug!("Manifest directory does not exists: {}", self.path); + return Ok(vec![]); + } + Err(e) => Err(e).context(OpenDalSnafu)?, + }; + streamer .try_filter_map(|e| async { Ok(filter(e)) }) .try_collect::>()