Skip to content

Commit ddb3d39

Browse files
authored
Simplify returned value when chunked reader is asked to read empty range (#7010)
This was a little bit too complex given what we were trying to do --------- Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent c4b9949 commit ddb3d39

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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

@@ -11,6 +12,7 @@ use futures::future::BoxFuture;
1112
use futures::stream::FuturesOrdered;
1213
use itertools::Itertools;
1314
use vortex_array::ArrayRef;
15+
use vortex_array::Canonical;
1416
use vortex_array::IntoArray;
1517
use vortex_array::MaskFuture;
1618
use vortex_array::arrays::ChunkedArray;
@@ -293,9 +295,7 @@ impl LayoutReader for ChunkedReader {
293295
) -> VortexResult<BoxFuture<'static, VortexResult<ArrayRef>>> {
294296
let dtype = expr.return_dtype(self.dtype())?;
295297
if row_range.is_empty() {
296-
return Ok(
297-
async move { Ok(ChunkedArray::try_new(vec![], dtype)?.into_array()) }.boxed(),
298-
);
298+
return Ok(future::ready(Ok(Canonical::empty(&dtype).into_array())).boxed());
299299
}
300300

301301
let mut chunk_evals = vec![];

0 commit comments

Comments
 (0)