diff --git a/src/daft-io/src/glob.rs b/src/daft-io/src/glob.rs index 2d0d95183e..edd709b9d4 100644 --- a/src/daft-io/src/glob.rs +++ b/src/daft-io/src/glob.rs @@ -32,7 +32,7 @@ impl GlobState { &self.glob_fragments[self.current_fragment_idx] } - pub fn advance(&self, path: String, idx: usize) -> Self { + pub fn advance(self, path: String, idx: usize) -> Self { GlobState { current_path: path, current_fragment_idx: idx, diff --git a/src/daft-io/src/object_io.rs b/src/daft-io/src/object_io.rs index de6f0da4b0..455cf6b26b 100644 --- a/src/daft-io/src/object_io.rs +++ b/src/daft-io/src/object_io.rs @@ -214,7 +214,7 @@ pub(crate) async fn glob( result_tx.clone(), source.clone(), // Do not increment `current_fragment_idx` so as to keep visiting the "**" fragmemt - state.advance( + state.clone().advance( fm.filepath.clone(), state.current_fragment_idx, ), @@ -311,6 +311,7 @@ pub(crate) async fn glob( result_tx.clone(), source.clone(), state + .clone() .advance(fm.filepath, state.current_fragment_idx + 1) .with_wildcard_mode(), ); @@ -330,7 +331,9 @@ pub(crate) async fn glob( visit( result_tx.clone(), source.clone(), - state.advance(full_dir_path, state.current_fragment_idx + 1), + state + .clone() + .advance(full_dir_path, state.current_fragment_idx + 1), ); } });