Skip to content

Commit 2cf490c

Browse files
authored
Fix: path fix for windows (#973)
fixes #824
1 parent ad977fd commit 2cf490c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/src/query/stream_schema_provider.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,18 @@ fn partitioned_files(
233233
columns,
234234
..
235235
} = file;
236-
partitioned_files[index].push(PartitionedFile::new(file_path, file.file_size));
236+
237+
// object_store::path::Path doesn't automatically deal with Windows path separators
238+
// to do that, we are using from_absolute_path() which takes into consideration the underlying filesystem
239+
// before sending the file path to PartitionedFile
240+
let pf = if CONFIG.storage_name.eq("drive") {
241+
let file_path = object_store::path::Path::from_absolute_path(file_path).unwrap();
242+
PartitionedFile::new(file_path, file.file_size)
243+
} else {
244+
PartitionedFile::new(file_path, file.file_size)
245+
};
246+
247+
partitioned_files[index].push(pf);
237248
columns.into_iter().for_each(|col| {
238249
column_statistics
239250
.entry(col.name)

0 commit comments

Comments
 (0)