Skip to content

Commit 70834cd

Browse files
committed
Simplify returned value when chunked reader is asked to read empty range
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 704f560 commit 70834cd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

vortex-layout/src/layouts/chunked/reader.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use std::collections::BTreeSet;
5+
use std::future;
56
use std::ops::Range;
67
use std::sync::Arc;
78

89
use futures::FutureExt;
10+
use futures::StreamExt;
911
use futures::TryStreamExt;
1012
use futures::future::BoxFuture;
1113
use futures::stream::FuturesOrdered;
1214
use itertools::Itertools;
1315
use vortex_array::ArrayRef;
16+
use vortex_array::Canonical;
1417
use vortex_array::IntoArray;
1518
use vortex_array::MaskFuture;
1619
use vortex_array::arrays::ChunkedArray;
@@ -293,9 +296,7 @@ impl LayoutReader for ChunkedReader {
293296
) -> VortexResult<BoxFuture<'static, VortexResult<ArrayRef>>> {
294297
let dtype = expr.return_dtype(self.dtype())?;
295298
if row_range.is_empty() {
296-
return Ok(
297-
async move { Ok(ChunkedArray::try_new(vec![], dtype)?.into_array()) }.boxed(),
298-
);
299+
return Ok(future::ready(Ok(Canonical::empty(&dtype).into_array())).boxed());
299300
}
300301

301302
let mut chunk_evals = vec![];

0 commit comments

Comments
 (0)