Skip to content

Commit 0dce6a1

Browse files
committed
Remove chunked special case from stat execution
Signed-off-by: Nicholas Gates <nick@nickgates.com>
1 parent 95f429d commit 0dce6a1

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

  • vortex-array/src/scalar_fn/fns

vortex-array/src/scalar_fn/fns/stat.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ use crate::ArrayRef;
1313
use crate::ExecutionCtx;
1414
use crate::IntoArray;
1515
use crate::aggregate_fn::AggregateFnRef;
16-
use crate::arrays::Chunked;
17-
use crate::arrays::ChunkedArray;
1816
use crate::arrays::ConstantArray;
19-
use crate::arrays::chunked::ChunkedArrayExt;
2017
use crate::dtype::DType;
2118
use crate::expr::Expression;
2219
use crate::expr::stats::StatsProvider;
@@ -115,26 +112,6 @@ impl ScalarFnVTable for StatFn {
115112
) -> VortexResult<ArrayRef> {
116113
let input = args.get(0)?;
117114
let dtype = stat_dtype(options.aggregate_fn(), input.dtype())?;
118-
119-
// Recurse into each chunk so the output keeps per-chunk granularity (one constant
120-
// per chunk) instead of collapsing to a single combined stat across the whole array.
121-
// Per-chunk granularity is what makes the result useful for pruning: predicates can
122-
// drop whole chunks at a time. Without this, we'd lose every chunk boundary as a
123-
// pruning opportunity. Other encodings (zone maps, etc.) will need similar
124-
// structure-preserving handling once they land.
125-
if let Some(chunked) = input.as_opt::<Chunked>() {
126-
tracing::trace!(
127-
"stat({}) descending into ChunkedArray with {} chunks",
128-
options.aggregate_fn(),
129-
chunked.nchunks()
130-
);
131-
let chunks = chunked
132-
.iter_chunks()
133-
.map(|chunk| stat_array(chunk, options.aggregate_fn(), dtype.clone(), chunk.len()))
134-
.collect::<VortexResult<Vec<_>>>()?;
135-
return Ok(ChunkedArray::try_new(chunks, dtype)?.into_array());
136-
}
137-
138115
stat_array(&input, options.aggregate_fn(), dtype, args.row_count())
139116
}
140117
}

0 commit comments

Comments
 (0)