From 0415d4a18698a275573ef39cd2f8def87bdd058a Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 14 Jan 2021 16:32:55 -0500 Subject: [PATCH] fix: Only treat PathBuf ending parts that match one of our extensions as file names --- object_store/src/path.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/object_store/src/path.rs b/object_store/src/path.rs index 2b61a675c4..9078d63742 100644 --- a/object_store/src/path.rs +++ b/object_store/src/path.rs @@ -330,7 +330,14 @@ impl From for DirsAndFileName { .collect(); let maybe_file_name = match parts.pop() { - Some(file) if file.0.contains('.') => Some(file), + Some(file) + if !file.0.starts_with('.') + && (file.0.ends_with(".json") + || file.0.ends_with(".parquet") + || file.0.ends_with(".segment")) => + { + Some(file) + } Some(dir) => { parts.push(dir); None