Skip to content

Commit 871fc3f

Browse files
author
Devdutt Shenoi
committed
refactor: only mutate file_path
1 parent 8a7cbf8 commit 871fc3f

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/query/stream_schema_provider.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use datafusion::{
5151
scalar::ScalarValue,
5252
};
5353

54-
use futures_util::{stream::FuturesOrdered, StreamExt, TryFutureExt, TryStreamExt};
54+
use futures_util::{stream::FuturesOrdered, StreamExt, TryStreamExt};
5555
use itertools::Itertools;
5656
use object_store::{path::Path, ObjectStore};
5757
use relative_path::RelativePathBuf;
@@ -379,8 +379,9 @@ fn partitioned_files(
379379
.enumerate()
380380
.map(|(x, y)| (x % target_partition, y))
381381
{
382+
#[allow(unused_mut)]
382383
let catalog::manifest::File {
383-
file_path,
384+
mut file_path,
384385
num_rows,
385386
columns,
386387
..
@@ -392,23 +393,15 @@ fn partitioned_files(
392393
// the github issue- https://github.com/parseablehq/parseable/issues/824
393394
// For some reason, the `from_absolute_path()` doesn't work for macos, hence the ugly solution
394395
// TODO: figure out an elegant solution to this
395-
let pf;
396-
397-
#[cfg(unix)]
398-
{
399-
pf = PartitionedFile::new(file_path, file.file_size);
400-
}
401396
#[cfg(windows)]
402397
{
403-
pf = if CONFIG.storage_name.eq("drive") {
404-
let file_path = object_store::path::Path::from_absolute_path(file_path).unwrap();
405-
PartitionedFile::new(file_path, file.file_size)
406-
} else {
407-
PartitionedFile::new(file_path, file.file_size)
408-
};
398+
if CONFIG.storage_name.eq("drive") {
399+
file_path = object_store::path::Path::from_absolute_path(file_path).unwrap();
400+
}
409401
}
410-
402+
let pf = PartitionedFile::new(file_path, file.file_size);
411403
partitioned_files[index].push(pf);
404+
412405
columns.into_iter().for_each(|col| {
413406
column_statistics
414407
.entry(col.name)

0 commit comments

Comments
 (0)